question

Cristian Daniel SG avatar image
0 Likes"
Cristian Daniel SG asked hermione12 commented

How can I change the speed of a transporter and an operator?

Model.fsmhi tech support team. @Ben Wilson @Jörg Vogel @jason.lightfoot


in this model there is a group of operators, with the same speed with load and without product load (each with its respective speed). but I need them to change speed when walking with product and without product. for example: operato1 with load 1 km / h and without load 2km / h; transporter1 with load 2km / h and without load 3 km / h.

How can I change the speed variable?


Thanks in advance

FlexSim 20.1.0
flexsim 20.1.0speed change
model.fsm (50.7 KiB)
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

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered hermione12 commented

Custom Code activity after load or unload: Identify conditionally the class by classobject(..)

Set variable of the taskexecuter (Operator or Transporter) "maxspeed" to a matching speed.

double speed = 3; // transporter empty [m/s]
if(classobject(current) == library().find("?Operator"))
	speed = 2; // operator empty [m/s]
token.OAlistador.setVariable("maxspeed",speed);

set_speed_conditionally_by_classobject.fsm


· 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.

Cristian Daniel SG avatar image Cristian Daniel SG commented ·

Thanks friend, your answer has been very helpful.

0 Likes 0 ·
hermione12 avatar image hermione12 commented ·
@Joerg Vogel

The same I want to update the Max speed of transporters. Once a transporter loads item the speed should change and transporter unloads item the speed should change (basically empty travel and non-empty travel speeds) through code. I have a dispatcher where 20 of my transporters are connected to it. How to do this?

I am not using any resource in process flow. Instead there is inter arrival source > custom code > sink.

In the custom code I have defined as ts.addtask() [all the tasks to the dispatcher needed].

How to change the loaded and unloaded speeds in this case?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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