question

Daniel Klemm avatar image
0 Likes"
Daniel Klemm asked Daniel Klemm commented

Railway Crossing Control by current Location

Hi,

in my program's logic I try to control a railway crossing by the last wagon's location. A 700m Train (AVG Network: Loco+36 coupled trailers) crosses the intersection. A control loop in the ProcessFlow looks into the x-Location of the last wagon and assigns a label. After reaching a specific value of x, an event is being triggered to open the intersection again for. Works for normal simulation run perfectly. As the model runs "Fast Forwards" the last wagon's x-Location in the label is not current x-Location anymore. Function "updateLocation()" before asking for the location doesn't work.

How to get the current wagon's location all the time? Do you have any suggestions to solve the problem?

Thanks

Daniel

FlexSim 22.2.0
agvlocationintersections
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Daniel Klemm commented

First of all - the Control Area should allow you to detect allocation and deallocation but it does not currently - only the head of the train is correctly detected - I will send the attached example in for the developers to consider fixing. At time 37.55 the area is about to be allocated by the lead trailer which is correct as shown here just after the allocation event with the train approaching from the left.

1671810890655.png

But at time 73.29 the area is about to be deallocated by the driver AGV (blue) which is in the middle of the train as shown below, before and after the event. This is incorrect as the last trailer should be the trigger for the deallocation to be consistent with the lead trailer.

1671810919767.png1671810938940.png

In the meantime you can use the AGV class to access the trailer objects and therefore the positions. In the attached model I show this on a visual tool in the model using this code:

  1. textnode.value="RearX:";
  2. AGV agv=AGV(current.agv);
  3. if (agv.trailers.length){
  4.     AGV.Trailer trailer=agv.trailers[agv.trailers.length];
  5.     Vec3 loc=trailer.object.location;
  6.     textnode.value+=loc.x;
  7. }

testTrainEndDetection.fsm


· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.