-1

I have a production model were the orders (agent population) run different stations. For each order the used stations and its sequence can be different. There are 12 different combinations of these stations. One random possibility should be assigned to the order.

How can I store and assign these possibilities in my Anylogic model? Which datatype would fit the best?

What I already tried was to use the Excel Interface, but as I later want to combine different possibilities to a longer list (about 50 possibilities combined with each other) Excel seems not the best way to do it.

I’m sure this is not a super hard problem, but I couldn’t find anything about it. Thanks in advance!

Anne
  • 1
  • 1
  • 1
    this really is many questions in one. Please check https://stackoverflow.com/help/how-to-ask and break up your general "how do I do X" question into separate issues. You will get good answers easier ;-) – Benjamin Feb 11 '20 at 10:59

1 Answers1

0

Hopefully I understand your question, so here it goes. The following is the model I propose: Model Structure Here the example has 3 stations (services). You put all the enter blocks in a collection called enterBlocks and all the names of the enter blocks on a collection called enterNames... so if you use excel, you can have in your excel the enter block names and initialize your enterNames collection in the beginning of the model by reading the excel. Each agent will probably have a different collection so the collection should be inside the agent, but here I'm just simplifying.

Then you use a counter (initial value 0) and a function called getNextService that will exist in each one of the 4 exit blocks. This function will choose the next station to use:

if(counter>=enterBlocks.size())//if the agent is done with all the stations
    end.take(agent); // take the agent to the exit
else{
    Enter enter=findFirst(enterBlocks,e>e.getName().equals(enterNames.get(counter)));//find the enter block with the correct name
    enter.take(agent); //take the agent to the correct station
    counter++; //update your counter
}
Felipe
  • 8,311
  • 2
  • 15
  • 31
  • Thanks Felipe, that was part of my problem. But what can I use to fill the collections if Excel is not a possibility for the database. Is there something directly in Anylogic that could be used? – Anne Feb 12 '20 at 15:35
  • I'm no wizard to guess what you want to do or why you wouldn't be able to use Excel or databases.. I actually explicitly created collections there in the example for you.. so please explain as clearly as possible why those collections are not good enough for you or why Excel or databases are not good enough for you... – Felipe Feb 13 '20 at 03:33
  • I have **6 Stations** (call them A,B,C,D,E & F) these can be combined in 11 fixed ways (like 1: ABC, 2: ABCDEF, 3: BECF…). For the orders the **11 possibilities** are combined randomly 40 to 60 times. The result would be thousands of different ways to combine them, I thought in Excel I need to write down each of the long combination lists separately. So I need an option to store just the 11 possibilities in AnyLogic that I can later write a Java Script that creates me a random routing out of these possibilities. – Anne Feb 13 '20 at 08:18
  • make 11 collections... and then use choose randomly (or not randomly) any of these collections... you can have the 11 possibilities in Excel... I still don't see your issue – Felipe Feb 13 '20 at 09:57