question

Eryn C2 avatar image
0 Likes"
Eryn C2 asked Ryan Clark commented

Convert queue to rack

Is there a way to convert a queue to a warehouse rack? I need to do this for multiple queues and am looking for a fast an easy way1.28 FGW - r9.fsm

FlexSim 21.2.2
warehousingracking
128-fgw-r9.fsm (256.7 KiB)
128-fgw-r9.fsm (256.7 KiB)
· 1
5 |100000

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

Ryan Clark avatar image Ryan Clark commented ·

Hi @Eryn C2, was Joerg Vogel's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Jason Lightfoot edited

You can’t exchange objects. There doesn‘t exists a universal container to hold classes of objects you can replace.
You can

  • put objects to same locations,
  • set a rank in a tree previous or next to another object
  • rebuild new connections (in / out / center) by data of existing objects

You can do this all by FlexScript. Unfortunately you try to replace a Fixed Resource Class object by a module class object which behaves only optionally like a fixed resource.

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

Felix Möhlmann avatar image Felix Möhlmann commented ·

Here is an example of how the code might look. The following copies an existing object (so you can set properties that will be shared between the racks beforehand, such as dimension for example). It then sets the location in the model and the tree and copies the send to port logic and connections to the new object.

Object queue = Model.find("QueueName");
Object storage = Model.find("RackName");

// Create copy
Object copy = createcopy(storage, queue.up);
// Copy location, tree rank and sendtoport
copy.location = queue.location;
copy.rank = queue.rank + 1;
copy.setVariable("sendtoport", queue.getVariable("sendtoport"));
// Copy connections
for(int in = 1; in <= queue.inObjects.length; in++)
{
    contextdragconnection(queue.inObjects[in], copy, "A");
}
for(int center = 1; center <= queue.centerObjects.length; center++)
{
    contextdragconnection(queue.centerObjects[center], copy, "S");
}
for(int out = 1; out <= queue.outObjects.length; out++)
{
    contextdragconnection(copy, queue.outObjects[out], "A");
}
1 Like 1 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Felix Möhlmann commented ·

You would be better to transfer the connection nodes which will then preserve any port ranks on the other objects.

/**transferConnections() user command*/
//  useage: transferConnections(fromobj, toobj)

Object from=param(1);
Object target=param(2);

while (connectionscenter(from).subnodes.length)
    transfernode(connectionscenter(from).first,connectionscenter(target));


while (connectionsin(from).subnodes.length)
    transfernode(connectionsin(from).first,connectionsin(target));


while (connectionsout(from).subnodes.length)
    transfernode(connectionsout(from).first,connectionsout(target));
1 Like 1 ·