simulationanylogicsimulate

Specific arrival times for agents


I have am model which simulates a distribution network. I have a population of agents (customers), develop from a database (address -> Gis Location and the order time) Also I have a order agent, which has a parameter "customer" I have a source in the customer agent to generate orders and the code at source exit: agent.customer = this; In the source I've set Arrival deffined by: Arrival table in Database and refer to the customer -> order time. My problem is, that I currently generating in every source of this population every order. How can I set up the source/model, that I generate at a specifc customer only the orders from this one?


Solution

  • Unfortunately, a Source object can only ingest the whole table and there is not function to filter records. One way to go about partitioning Order agents is by creating all of them in a single source somewhere in the model and then using Exit to send them to an Enter object within a specific Customer agent. To summarise:

    1. There is a single Source that reads the 'Orders' table for all customers
    2. Each record has a field with 'customer id' so when agent gets created it has a property of which customer it belongs to
    3. Source object feeds all new Order agents into an Exit object
    4. Each Customer agent has an id and an Enter object
    5. Source's Exit object contains code which finds Customer agent based on 'customer id' property and then calls customer.enter.take(agent) to send the Order agent into the right Customer agent

    More information about here: Enter and Exit.