i have a transporter that make always the same route, i wanto to know how many times the transporter make this route per day, and the time for each one.
it starts at the SensorID 6, for me this sensor is the reference of time. i want to make this sensor as the point where the transporter stop after 24 hours or when it finishes the route but also i dont know how ...
i want also to simulate that this tranporter pull 4 trollies behind but i dont know if its possible to do.
thanx in advance
Solved! Go to Solution.
you could use a user defined attribute in the transporter for store the number of rounds. Just increment the value after each start of the transporter at Sensor 6.
To get the number of rounds you can use e.g. a TimeSequence. Record the value of the user defined attribute with an interval of one day. Or you use a Generator to call a method with an interval/ delay of one day.
You can define the transporter as Tractor (see menu of the Transporter). Then you can hitch other transporters (e.g. using the collision control of the tractor).
Look here for an example:
thank you Steffen_B. i tried to apply the metho of creating a wagon but i couldnt do it.
i have changed a little bit the self.collisionControl of the tractor but it doesn't work
-- hitch wagons behind the tractor
-- move after hitch-time
if self.~.backwards then
car := self.~;
for i:=1 to 2 loop
-- is there a wagon?
if not isVoid(car.rearMU) then
in this code i dont understand this condition "if not isVoid(car.rearMU) "
and i dont know where to change or set up the hitchTime.
First: to hitch a wagon, this must be located directly infront or behind the transporter. So you have two options: the wagons drive against the tractor or the tractor drives against the waiting wagons.
My example deals with the second option. You need to stop the first wagon (see init-method) and let all wagons and the tractor drive backwards against the first transporter. In the collision control then you can hitch all wagons (I have changed your version a little bit). In the sensor controls you can only stop the tractor (you can check the transporter with @.isTractor).
isVoid is an old syntax, use instead:
if car.rearMU /= void then
thank you very much, it works perfectly. i just have a question about a method that you have changed, its the method of the sensors
if @.isTractor then
waituntil @.operational prio 1;
i dont understand very well the meaning of @.operational prio 1.
another thing can you recommend me an example to do the first part of my problem, i mean the time measurement, i dont know which attribute of tranporter i have to use or how to
thanks in advance!
If you pause the tractor, the complete train is paused. If you set stopped:=false in the tractor during the pause, the tractor starts without the wagons. So you need to wait until the pause is over (waituntil @.operational prio 1; see help --> operational) to start the complete train.
Have a look in the attached model for your first problem. I added two user defined attributes into the tractor. These attributes I set in the method stop...
you cannot record timesRuta with the timesSequence, because it is a list.
You cannot adress the class of the tractor in the TimeSequence, you need to adress the instance in the frame. The class itself dont collect the data, you want to show.
To record e.g. startRuta, you need a reference to the tractor in your frame. I have inserted a globale variable into your frame (tractor: object). In the init you can set the reference, when you create the tractor:
Now you can use this variable to access the attributes of the tractor for the TimeSequence.
Thank you very much Steffen!
anther question please , to visualize the timesRuta lista , how can i do it? i want it to know how mnay round the tractor have done at the end of the day
you can use the global variable to access the list inside the tractor. Try to use it as datasource for a chart object.