Why SUMO output different using veins_launchd and without veins_launchd? - omnet++

First, I use veins_launchd to conect omnet and sumo, the command line is "D:/example_project/veins-5.1/veins-veins-5.1/sumo-launchd.py -vv -c 'D:/Program Files (x86)/Eclipse/bin/sumo.exe' "
The ouput lane data is shown below:
But I want to run SUMO manually, so I modify TraCIScenarioManagerLaunchd to TraCIScenarioManager and use the command line "sumo -c llcd.sumocfg --remote-port 9999", and then waiting for omnet to connected. This approach is inspired by this answer Is there a way to connect multiple TraCI modules to the OMNet++/veins simulation?
But when I run this way, the output result is like this:
Why do simulation results make such a huge difference? I didn't change any other parameters, and the sumo configure file is the same.
some of the parameter setting in omnetpp.ini:
##########################################################
# TraCIScenarioManager parameters #
##########################################################
*.manager.updateInterval = 1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.autoShutdown = false
*.manager.launchConfig = xmldoc("llcd.launchd.xml")
sumo.config:
<configuration>
<input>
<net-file value="D:\FTT\sumo_test\llcd\llcd.net.xml"/>
<route-files value="D:\FTT\sumo_test\llcd\llcd.rou.xml"/>
<additional-files value="D:\FTT\sumo_test\llcd\llcd.add.xml"/>
</input>
<output>
<lanechange-output value="D:\FTT\sumo_test\llcd\llcd.lanechange.xml"/>
<summary-output value="D:\FTT\sumo_test\llcd\output_sumo.xml"/>
</output>
<time>
<begin value="0"/>
<end value="3600"/>
</time>
<processing>
<time-to-teleport value="-1"/>
</processing>
<report>
<no-duration-log value="true"/>
<no-step-log value="true"/>
<no-warnings value="true"/>
</report>
</configuration>
If anyone can give some insights? Thank you in advance!

I figured out the problem. I found veins_launchd will change the configure file of SUMO by adding
<random_number>
<random value="false"/>
<seed value="0"/>
</random_number>

Related

Freeswitch use mod_lcr with originate api

Is there a way to use mod_lcr with originate command?
I want to originate a call and have mod_lcr decide which gateway should be used based on lcr rules (cost, reliability, etc).
When mod_lcr is used in the dialplan it will populate a variable ${lcr_auto_route} with the dialstring. How can I use the same logic with originate?
Thank you.
Here is how I did it.
I connect to freeswitch via ESL and execute the command
lcr 1716 default as xml
where 1716 is the digit sequence and default is the profile name (you can replace default with your own profile name)
Note 'as xml' will return an XML response. The response looks like this:
<result>
<row id="1">
<prefix>1716</prefix>
<carrier_name>carrier1</carrier_name>
<rate>0.15000</rate>
<codec></codec>
<cid></cid>
<limit></limit>
<dialstring>[lcr_carrier=carrier1,lcr_rate=0.15000]sofia/gateway/carrier1/1716</dialstring>
<event>
<headers>
<Event-Name>REQUEST_PARAMS</Event-Name>
<Core-UUID>151c590b-cce8-4eb3-b3ae-f48bad397870</Core-UUID>
<FreeSWITCH-Hostname>freeswitch</FreeSWITCH-Hostname>
<FreeSWITCH-Switchname>freeswitch</FreeSWITCH-Switchname>
<FreeSWITCH-IPv4>172.16.124.130</FreeSWITCH-IPv4>
<FreeSWITCH-IPv6>%3A%3A1</FreeSWITCH-IPv6>
<Event-Date-Local>2018-02-20%2007%3A33%3A42</Event-Date-Local>
<Event-Date-GMT>Tue,%2020%20Feb%202018%2006%3A33%3A42%20GMT</Event-Date-GMT>
<Event-Date-Timestamp>1519108422660002</Event-Date-Timestamp>
<Event-Calling-File>mod_lcr.c</Event-Calling-File>
<Event-Calling-Function>route_add_callback</Event-Calling-Function>
<Event-Calling-Line-Number>633</Event-Calling-Line-Number>
<Event-Sequence>786</Event-Sequence>
<lcr_digits>1716</lcr_digits>
<lcr_carrier_name>carrier1</lcr_carrier_name>
<lcr_rate_field>0.15000</lcr_rate_field>
<lcr_gw_prefix>sofia/gateway/carrier1/</lcr_gw_prefix>
<lcr_lead_strip>0</lcr_lead_strip>
<lcr_trail_strip>0</lcr_trail_strip>
</headers>
</event>
</row>
<row id="2">
<prefix>1</prefix>
<carrier_name>carrier2</carrier_name>
<rate>0.12000</rate>
<codec></codec>
<cid></cid>
<limit></limit>
<dialstring>[lcr_carrier=carrier2,lcr_rate=0.12000]sofia/external/0716#proxy.carrier2.net:5060</dialstring>
<event>
<headers>
<Event-Name>REQUEST_PARAMS</Event-Name>
<Core-UUID>151c590b-cce8-4eb3-b3ae-f48bad397870</Core-UUID>
<FreeSWITCH-Hostname>freeswitch</FreeSWITCH-Hostname>
<FreeSWITCH-Switchname>freeswitch</FreeSWITCH-Switchname>
<FreeSWITCH-IPv4>172.16.124.130</FreeSWITCH-IPv4>
<FreeSWITCH-IPv6>%3A%3A1</FreeSWITCH-IPv6>
<Event-Date-Local>2018-02-20%2007%3A33%3A42</Event-Date-Local>
<Event-Date-GMT>Tue,%2020%20Feb%202018%2006%3A33%3A42%20GMT</Event-Date-GMT>
<Event-Date-Timestamp>1519108422660002</Event-Date-Timestamp>
<Event-Calling-File>mod_lcr.c</Event-Calling-File>
<Event-Calling-Function>route_add_callback</Event-Calling-Function>
<Event-Calling-Line-Number>633</Event-Calling-Line-Number>
<Event-Sequence>787</Event-Sequence>
<lcr_digits>1</lcr_digits>
<lcr_carrier_name>carrier2</lcr_carrier_name>
<lcr_rate_field>0.12000</lcr_rate_field>
<lcr_gw_prefix>sofia/external/</lcr_gw_prefix>
<lcr_gw_suffix>%40proxy.carrier2.net%3A5060</lcr_gw_suffix>
<lcr_lead_strip>1</lcr_lead_strip>
<lcr_trail_strip>0</lcr_trail_strip>
<lcr_prefix>0</lcr_prefix>
</headers>
</event>
</row>
</result>
Then I parse the XML and grab the dialstring which is in this case
<dialstring>[lcr_carrier=carrier1,lcr_rate=0.15000]sofia/gateway/carrier1/1716</dialstring>
Then I use the dialstring (with some extra variables) in my originate command.

Whats the applescript syntax for sending arguments?

I'm following apples applescript example for scripting parameters
I can send the direct parameter no problem using the following syntax
tell app "SimpleScriptingVerbs" to do command with args "Im a direct parameter"
However I can't figure out the correct syntax for sending the other optional arguments.
The rest of the accepted optional arguments look like this
<command name="do command with args" code="SVrbAgCm" description="run a command with a bunch of arguments">
<cocoa class="CommandWithArgs"/>
<direct-parameter description="a text parameter passed to the command">
<type type="text"/>
</direct-parameter>
<parameter name="blinking" code="savo" type="boolean" optional="yes"
description="a boolean parameter.">
<cocoa key="SaveOptions"/>
</parameter>
<parameter name="preferred hand" code="LRnd" type="preferredhands" optional="yes"
description="a parameter using our enumeration.">
<cocoa key="TheHand"/>
</parameter>
<parameter name="prose" code="Pros" type="text" optional="yes"
description="a text parameter.">
<cocoa key="ProseText"/>
</parameter>
<parameter name="ivalue" code="iVal" type="integer" optional="yes"
description="an integer parameter.">
<cocoa key="IntegerValue"/>
</parameter>
<parameter name="rvalue" code="rVal" type="real" optional="yes"
description="an real number parameter.">
<cocoa key="RealValue"/>
</parameter>
<result type="text" description="the direct parameter enclosed in quotes"/>
</command>
What's the correct applescript syntax to send the rest of these arguments.
You must use a parameter's name with a value, like this:
tell application "SimpleScriptingVerbs" to do command with args "Something" prose "bla 1" preferred hand Left Hand ivalue 299 rvalue 75.777
The application logs -->
proc=-[CommandWithArgs performDefaultImplementation] The other parameters are: '{
"" = Something;
IntegerValue = 299;
ProseText = "bla 1";
RealValue = "75.777";
TheHand = 1279816302;
}'

How to access XML parameters conditionally

This is a XML code snippet:
<testcase name="T.3.03.02">
<cmd>CMD_EXPORT_RAM_KEY</cmd>
<sreg_pre>40</sreg_pre>
<sreg_pre_bitmask>ff</sreg_pre_bitmask>
<sreg_post>40</sreg_post>
<sreg_post_bitmask>ff</sreg_post_bitmask>
<erc>ERC_NO_ERROR</erc>
<testvector>
<parameter name="UID" type="info">000000000000000000000000000002</parameter>
<parameter name="UID'" type="info">000000000000000000000000000002</parameter>
<parameter name="KeyId" type="info">0e</parameter>
<parameter name="Key" type="info">0f0e0d0c0b0a09080706050403020100</parameter>
<parameter name="AuthId" type="info">00</parameter>
<parameter name="KeyAuth" type="info">2b7e151628aed2a6abf7158809cf4f3c</parameter>
<parameter name="Old counter value of updated key slot" type="info">0000000</parameter>
<parameter name="New counter value C'" type="info">0000000</parameter>
<parameter name="Protection flags F'" type="info">00</parameter>
<parameter name="M1" type="output">000000000000000000000000000002e0</parameter>
<parameter name="M2" type="output">152876f29dc7ca8d18e38d70374492b05d908c8c584a0409849a553c75254def</parameter>
<parameter name="M3" type="output">bc6e79bc4458339174fc80fb08b83188</parameter>
<parameter name="M4" type="output">000000000000000000000000000002e07783b86ae87b87e3ca12809c2df75fae</parameter>
<parameter name="M5" type="output">c8fcc8859c69c8bd840ce8e24c5114e9</parameter>
</testvector>
<precondition>RAM_KEY_PLAIN = 1; RAM_KEY_EMPTY = 0</precondition>
<description>Export plain RAM_KEY with external debugger attached; Note: The security flags SECURE_BOOT_PROTECTION and DEBUGGER_PROTECTION of the key SECRET_KEY are inherited from MASTER_ECU_KEY.</description>
</testcase>
I want to access all "parameter name="Key" type="info" values.
How do I access these values conditionally if the condition <cmd>CMD_EXPORT_RAM_KEY(second line in XML)</cmd> is valid.
In this XML file there are also other commands (<cmd> lines) also with the "Key" parameter,
but in these cases I don't want to get the key-values.
I didn't get it running.
Can anyone help me with some ideas?
Would something like this work?
doc = Nokogiri::parse(File.read( "data.xml" ))
check = doc.xpath( "//cmd" ).select{|el| el.children[0].text == "CMD_EXPORT_RAM_KEY" }
puts "Check: %i" % check.size
if(check.size == 0)
## Do stuff here
end
Try the below XPath with Nokogiri:
//testcase/cmd[text()='CMD_EXPORT_RAM_KEY']/../testvector/parameter[#name="Key" and #type="info"]
Of course, you can parameterize the CMD_EXPORT_RAM_KEY and #name/#type values.
The trick is to locate the specific ones you want using a selector, then narrow down further if necessary.
Using the CSS selector 'parameter[#name="Key"][#type="info"]' Nokogiri easily finds the single occurrence in your sample. If there were more, then more would be returned:
require 'nokogiri'
doc = Nokogiri::XML(<<EOT)
<testcase name="T.3.03.02">
<testvector>
<parameter name="UID" type="info">000000000000000000000000000002</parameter>
<parameter name="Key" type="info">0f0e0d0c0b0a09080706050403020100</parameter>
</testvector>
</testcase>
EOT
doc.search('parameter[#name="Key"][#type="info"]').map(&:content)
# => ["0f0e0d0c0b0a09080706050403020100"]
I used CSS because it looks less like line noise than the equivalent XPath selector would.
Also, when supplying sample data, reduce it to the bare minimum necessary to test the code. Anything beyond that wastes our time, and, if it's too much, can actually cause you to get no answers because nobody wants to wade through that.

IzPack: get user input then process it in the processpanle

H,
I need to get a user input during installation then use it as an argument for an application which is executed in the processPanle. How can I get the variable which contains the user input in the processPanel?
You can reference the variable using ${} syntax like shown in the following example.
userInputSpec.xml (snippet):
<field type="rule" variable="tomcat_http_port">
<spec txt="HTTP-Port:" id="panel0.field2.label" set="0:80" layout="N:5:5" />
</field>
process.xml (snippet):
<job name="Launching Browser">
<executeclass name="edu.ccdb.util.BareBonesBrowserLauncher">
<arg>http://localhost:${tomcat_http_port}/klaros-web</arg>
</executeclass>
</job>

AppleScript script command implementation

I'm trying to implement a trivial script command, byt have no success..
My sdef file
...
<class name="image" plural="images" code="imag" description="Image class">
<cocoa class="MyImage" />
<property name="width" code="wdth" type="real" access="r" description="The width of the image."/>
<property name="height" code="hght" type="real" access="r" description="The height of the image."/>
<responds-to name="rotate">
<cocoa method="scriptingRotate:"/>
</responds-to>
</class>
<command name="rotate" code="frwkrota" description="Rotate the image.">
<direct-parameter type="image"/>
<parameter name="by" code="by " type="real" description="Degrees to rotate.">
<cocoa key="angle"/>
</parameter>
</command>
...
My dictionary is ok: image responds to rotate and so on..
But
tell application "MyApp"
rotate image 1 by 1
end tell
says that: "Expected end of line but found class name." Where is the mistake?
get image 1 works normally (MyImage have objectSpecifier).
SOLVED
Seems like it was a bug with ScriptEditor..
Restarting ScriptEditor solved the problem.

Resources