I use Siouxfalls network for simulation, and in run-time, I want to close the edge from node 19 to node 17 (which is named 19to17).
To do this, I use additional file like this:
<rerouter id="rerout1" edges="19to17" probability="1.0">
<interval begin="300" end="1500">
<closingReroute id="19to17"/>
</interval>
</rerouter>
This rerouter does not make any change in vehicle movements and all vehicles used to pass 19to17, again pass it, but this time with just a warning.
Next time, I add the following line after closingRoute to show the other routes that they can choose:
<destProbReroute id="19to15;15to10;10to17"/>
I have the warning for ';', so I separet it in three lines:
<destProbReroute id="19to15"/>
<destProbReroute id="15to10"/>
<destProbReroute id="10to17"/>
And again no change in the output results!
So, How does the rerouter work?
Thanks in advance
The (closing) rerouter needs two sets of edges one which gets closed and one where the vehicles get notified of the closure. It is not a good idea to let the notification edge be a closed edge because it is too late to find a new route if you are already on the closed edge.
The notification edges are the ones in the edges attribute of the rerouter while the closed edge is the id in the closingReroute part. The first one should be upstream of the second.
Related
I’ trying to build a Petri Net with Cytoscape.js, using Dagre.js layout and compound nodes for representing places witch in turns are subnets.
I’ using Expand-Collapse extension (Dagre layout) , starting with an overall collapsed network. As the net evolve, I need to update data on every node, including children of collapsed nodes witch users may decide to expand or not .
Here is the issue: I’ not able to select nodes inside collapsed ones nor I can test with IsParent() or any other function applying to compound nodes including slector like “node > node”. Any idea ?
Thanks.
You can't change state of elements that aren't in the graph. Modify them after you add them back (.restore()) to the graph instead.
Background
So I have my main graph:
var cy = cytoscape { ... }
I am running it headless as it is sufficiently large.
I would like to, given a node id (n-id), make a non-headless instance from my main graph, which is based upon all nodes / edges in the neighborhood of degree d centered at n-id.
so the first part isn't too complicated...
cy.getElementById('n-id')
in principal I should be able to chain methods to get the desired result
cy.getElementById('n-id').neighborhood(SELECTOR).add(cy.getElementById('n-id'))
where we have the add command because the neighborhood doesn't include the calling node.
Questions
So my questions are the following
1.) what is the appropriate selector? [degree <= d] doesn't work
2.) now that I have my neighborhood, how do I turn it into a non-headless instance for visualization?
E.g. cy2.add( cy1.getElementById('#some-node').closedNeighborhood('[[degree = 5]]') )
I'm trying to check if a value is contained in the innertext of a webelement but I'm having a little problem: frames seem to change at every refresh of the pages.
These are the steps I've recorded:
Browser("SystemPage").Page("SystemP").Frame("dme2_header").Image("Gestione Anagrafiche").Click<br>
Browser("SystemPage").Page("SystemP").Frame("dme2_appl").WebEdit("pdrBean.pdrPod").Set parameter("POD")<br>
Browser("SystemPage").Page("SystemP").Frame("dme2_appl").WebButton("Cerca").Click
Browser("SystemPage").Page("SystemP").Frame("dme2_appl_2").Image("show_files").Click
Browser("SystemPage").Page("SystemP").Frame("dme2_appl_6").Image("Lente").Click
cctype = Browser("SystemPage").Page("SystemP").Frame("dme2_appl_7").WebElement("arrow_down").GetROProperty("innertext")<br>
DataAct = Browser("SystemPage").Page("SystemP").Frame("dme2_appl_7").WebElement("arrow_down_2").GetROProperty("innertext")<br>
Browser("SystemPage").Page("SystemP").Frame("dme2_header").Image("Gestione Anagrafiche").Click
The frames "dme2_appl6" and "dme2_appl7" changes at every refresh of the two pages.
The question is simple: how can I rewrite these two actions to make them universal?
I've tried to do something like:
Set objFrame = Frame("title:=dme2_appl_.")
and then
Browser("SystemPage").Page("SystemP").objFrame.Image("Lente").Click
But QTP gives me an error in return: "property or method not supported by the object"
Please try using the below code
Browser("SystemPage").Page("SystemP").Image("Lente").Click
Avoid using the "Frame" and if you really want to use it, put regex for name property of Frame.
Go to Object Properties--> Click on the Frame object --> Mandatory Properties--> Change name property as
like iFrame_213123123 to i.*
Hope this will solve your problem.
I don't think you can use a frame object that way. When you write Page().Frame() UFT sets the frame's parent in different way than if you first create the Frame.
Think of Frame() as a function that behaves differently when called on a Page or as a free function.
Try:
Browser("SystemPage").Page("SystemP").Frame("title:=dme2_appl_.")
So basically I have these two DateTextBoxes and I want to copy the value from one to another? Sounds easy, right? Still, it is not...
I tried to do it this way:
dojo.byId("datetextbox1").value = dojo.byId("datetextbox2").value;
it actually looks like the value changes as the content of the field changes, but it doesn't really. When I inspect the element with firefox it still contains the old value in the code and when I try to submit the form, the old value is sent!
So my question is: how should I change that damn value?
You'll want to set the value on the widget and not directly on the node.
dijit.byId("datetextbox1").set('value', dijit.byId("datetextbox2").get('value'));
dijit.byId grabs widgets, dojo.byId grabs dom nodes
I was wondering how feasible is to add some compound elements (nodes) "on the go".
Scenario:
I have a network with nodes from n1...n10 and edges. Depending on the button the user clicks, it redraws my network including nodes inside a compound node.
Example:
When you open the graph, you have n1..n10, without compounds, but when you click on a pre-defined button, my new graph now would be:
A new compound node with n1:n5 inside (parent), and the rest n6:n10 would stay the same (outside compound).
How feasible is it ?
I've tried :
cy.batchData({
"5": {
parent: "n0" // new element I added earlier
}});
to update my element id=5 to have n0 as parent, but it haven't worked.
The main idea is to represent data (graph) with biological insight, where the "new compound area" would be a pathway or a metabolic path (or whatever I want to represent there), one by one, so the visualization won't be a mess.
Thank you.
You can't change the parent field; it's immutable. You may have to remove the elements and add the second (resultant) graph via eles.remove() and cy.add() respectively.