question

Claire Krupp avatar image
0 Likes"
Claire Krupp asked Joerg Vogel commented

How can I change the AGV Type of an object created in Process Flow?

I am using Process Flow to create people as they arrive on buses. I am creating them at a Control Point in an AGV network so that I can use the collision avoidance features of the AGV paths. I have the Person "max speed" set in the Flowitem Bin, and each person has the correct speed in the Quick Properties, but the network is ignoring that, and using the speeds in the AGVNetwork Properties, which is for the buses.

I set up a second AGV Type for "DefaultPerson", but when the person is created it automatically becomes .agvType = 1 and it uses the first row. The same thing happens with the buses (which are also created in PF), so if I switch the DefaultPerson to the first row then all the buses travel too slowly.

I don't see anything see in the Process Flow "Create Person" activity to allow me to set the agvType, so how would I do that? (I looked into the "Create Object" activity and that does not have an obvious way to do it either.)

FlexSim 19.0.0
agv networkcreate object
· 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.

Jeff Nordgren avatar image Jeff Nordgren commented ·

@Claire K,

Is it possible to attach your model or a sample model of the problem area? Without a model to look at it's very hard to give you a specific or even correct answer.

Thanks.

1 Like 1 ·
Claire Krupp avatar image Claire Krupp Jeff Nordgren commented ·

I will send it to [email protected].

I found a way to do it that my coworker showed me. I put it in Custom Code immediately after the Person was created: (the last line is just to verify that it worked correctly.)

It works very well but was not easy to find, so I was hoping there was a more standard way to do it.

Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);


Object Employee = token.Person;
string name = getname(Employee);

Model.find("AGVNetwork>variables/agvs/" + name + "/agvType").value = 2;


Variant no = Model.find("AGVNetwork>variables/agvs/" + name + "/agvType").value;


0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered Joerg Vogel commented

You can use the AGV() command to get direct access to that agv data node rather than referencing it by name in a path:

AGV agv = AGV(token.Person);
agv.as(treenode).find("agvType").value = 3;

I'll add a case to the dev list to consider adding a property to the AGV FlexScript class to access agvType directly.

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

Claire Krupp avatar image Claire Krupp commented ·

Thank you!

0 Likes 0 ·
Tanmay Varshney avatar image Tanmay Varshney commented ·

@Phil BoBo ,

Adding to the above query, I want to change the speed variables of the agv (which I suppose is possible with different agv type). Later changing the agv type in a running model by UserEvent, the speed doesnt changes, rather it gets activated at new task.

Can you help me, how to change the speed of the agv dynamically in executing the same task

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Tanmay Varshney commented ·
@Tanmay Varshney, I suggest you ask a complete new question. If it is necessary to get informations from an accepted answer, you can still submit a link to the post. An new question involves some useful information you can post like an actual version you ask your question for or what you have already tried by yourself. Thank you for considering my suggestions. Jörg
1 Like 1 ·

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.