I open this new question directly linked to my previous question posted here: Avoid Exceptions after a train collision in Anylogic
In a rail scenario, we use blocks to control and make run/stop trains. In the most simple scenarios, where trains and rail cars have no specific proprieties to embed, Trains and RailCars can be normal Agents. In a TrainMoveTo block, we simply specify the acceleration and speed of the train and it moves consequently toward the specified target.
My scenario uses a RailSettings block to capture the event "On car hit car". Its parameters are:
RC car
— the car
boolean frontside — the side of the car that hits another car (true if front side)
RC other
— another car
RailwayTrack track
— the track where this is happening
RailwayNetwork railYard
— the rail network defining the railyard
if I call car.something
, Anlylogic handles it as a simple Agent and I'm wondering, which function should I access to specify the very same information that I order via "TrainMoveTo" blocks? I tried with a simple car.stop()
to make the train stop, but it didn't work.
The same question rises too in the very same case I want to create a specific Train and RailCar function and I want to control train parameters via code.
Can Anyone help me to understand this? Thanks a lot! Piero