-1

Distribution centers (agent) will send a work order to manufacturing centers (agents at multiple locations on GIS map)

At a distribution agent, i added codes below

TestOrder testorder = new TestOrder (this); 

// "this" is location of a distribution agent

send (testorder, getNearestAgentByRoute(main.manufacturingcenters)); 

// send the testorder to the nearest agent

Then i set up "enter" in the manufacturing center agent with Agent type, TestOrder.

However, there is no input in the simulation and shows an error on the code below

send (testorder, getNearestAgentByRoute(main.manufacturingcenters)); 
Hello-experts
  • 113
  • 1
  • 1
  • 10

1 Answers1

0
  • "this" is the distribution agent, not the location of the distribution agent... testOrder(this) means that your testOrder agent has a parameter which is a distribution agent.. is that correct? If not, you have a problem there... I'm assuming that testOrder is an agent type, otherwise you wouldn't be able to send anything with the send function.
  • send (testorder, getNearestAgentByRoute(main.manufacturingcenters); is missing a parenthesis at the end. That's one reason you are getting an error.
  • If you have an enter element from the process modeling library, to generate an agent in the enter block you need to do enter.take(agent);
Felipe
  • 8,311
  • 2
  • 15
  • 31
  • Thanks for the reply! I set up the system as you mentioned at 1 and 2. I got this error message " manufacturingcenters can't be resolved to a variable" – Hello-experts Apr 11 '18 at 12:23
  • because manufacturingcenters is probably an agent type.. and not a population of agents... that's one possibility... but it can be many other things – Felipe Apr 11 '18 at 12:31
  • manufacturingcenters is a population of agents created by GISpointcollections. hm,,, the simulation works flawlessly but only the testorder is not captured in a manufactoring center. I'll look into it and update if there is something else Thanks! – Hello-experts Apr 11 '18 at 12:54