branch choice

890 views
Skip to first unread message

johannhe...@gmail.com

unread,
May 24, 2018, 6:06:02 AM5/24/18
to Jaamsim Users Discussion Group
Hello,

I have a problem with my branch. I don't know why but it isn't working.

I want the branch to put the simentity to a free server (there a 3 in my simulation) and if all of them are in use the simentity should go to the server with the shortest queue.

What to i have to put into the choice feld?

Best,
Jo

Chux Nwogu

unread,
May 24, 2018, 6:32:44 AM5/24/18
to Jaamsim Users Discussion Group
Hi Jo

I am new too to JaamSim, but I had similar issue and tried an example I came across here or on youtube, and it worked.

Say you have three servers - Server1, Server2 and Server3, each with their corresponding queues (Queue1, Queue2 and Queue3), then apply the following on NextComponentList and Choice fields of the Branch:
         
NextComponentList: Server1 Server2 Server3
Choice: 'indexOfMin( [Queue1].QueueLength, [Queue2].QueueLength, [Queue3].QueueLength)'

Good luck!

Chux

johannhe...@gmail.com

unread,
May 24, 2018, 7:03:29 AM5/24/18
to Jaamsim Users Discussion Group
Hey Chux,

year I found them too but a lot of them are in spanish.. and i don't speak spanish:/

That is exactly what I have at the choice field but for some reason I don't unterstand the first two simentitys go to the first server, than the second server gets simentity nr. 3 & 4 and server3 gets simentity nr. 5 & 6... and so on.

Why is that happening?

Best,
Johann

Chux Nwogu

unread,
May 24, 2018, 12:01:02 PM5/24/18
to Jaamsim Users Discussion Group
Johann

I don't understand a word of Spanish too, but I look at the models as they go along.

My understanding of what was implemented in the Choice field of the Branch (as described by our previous emails) is that the Branch would forward an incoming entity to the shortest queue. I don't think it is doing anything clever.

I think you could assign an attribute to an entity and route it accordingly. I did that in my model. I will write tonight with the details of how I did it. 

You could share you model, if you don't mind, and I give it a go! 

There is not a lot of help, so I keep record of all my issues and how they get solved, so that I could share in future. I hope you are doing same!

Have a nice day.

Chux

johannhe...@gmail.com

unread,
May 28, 2018, 5:04:37 AM5/28/18
to Jaamsim Users Discussion Group
Hey Chux,
thank you so much for your help.
That would be wonderful if you could give it a go! But How can I send you the file?

Best
Johann

Am Donnerstag, 24. Mai 2018 12:06:02 UTC+2 schrieb johannhe...@gmail.com:

Johan Basson

unread,
Mar 9, 2021, 12:49:35 PM3/9/21
to Jaamsim Users Discussion Group
Hello,

I am currently sitting with the same problem of branching out into three branches and was wondering if this was ever resolved?

regards,
AJ Basson

Harry King

unread,
Mar 9, 2021, 7:09:54 PM3/9/21
to Jaamsim Users Discussion Group
The example model 'Branch Example - select shortest Queue' demonstrates how to do this.  You can find it at Help > Examples.

Harry

Cristiano Luís

unread,
Mar 18, 2021, 9:30:21 AM3/18/21
to Johan Basson, Jaamsim Users Discussion Group
Problem solved attachment. Please check. Thank you very much.

Atenciosamente,
Cristiano Luís Turbino de França e Silva
==============================
                      GNU / Linux
    ,                ,       /       .-.
   /                  \     /      (e e)
  ((__-^^-,-^^-__))   /     _.`V'._
    `-_---' `---_-'      /    //~~W~~\\
  <__|o ` 'o|__>   /    //,           ,\\
        \   `  /       /    // |            | \\
         ):  :(      /      \) |            | (/
        :o_o:    /           \           /
          "-"    /              `w -  w'


--
You received this message because you are subscribed to the Google Groups "Jaamsim Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jaamsim-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jaamsim-users/130e3016-75f2-4c9a-94a1-62a79bc5056an%40googlegroups.com.
01.png
teste.cfg
Reply all
Reply to author
Forward
0 new messages