-3

i create a supply chain model in anylogic that have a distributor and 8 trailer and 5 trucks for Transport Order from distributor to retailers.

now anylogic routing are Automatic but i want to write the agents(trucks) that They can choose their own road. what should I do? grateful

  • Do you use the road traffic library or a GIS map? Please be more specific, add screenshots, etc. Also, what research have you done yourself already? cheers – Benjamin Dec 14 '16 at 08:21
  • yea i use GIS map i want to trucks can decide choose road now routing is automatic in anylogic – javad karimian Dec 14 '16 at 13:45

2 Answers2

2

In order to move an agent along the given route, you need to create a Route Provider by code and set it as route provider for the agent. The code sample can be found in the following example model: https://www.dropbox.com/s/o5w2bw6cn9l8ez8/DynamicRoutes.alp?dl=0

You can specify any route drawn on the GIS map as argument of the function "getCustomRouteProvider()".

One important comment to the example model: when the initial location or target for an agent is defined as GIS Point of a network, the agent uses the shortest (fastest) route of the network to reach the destination. In order the agent follows the route specified while creating the custom route provider instead of, the agent is initially placed in the point defined by the latitude and longitude of the "gisPointStart" and moved to the point with coordinates (gisPointEnd.getLatitude(), gisPointEnd.getLongitude()).

Tatiana Gomzina
  • 274
  • 1
  • 4
0

Using the GIS map, you can only make trucks use specific roads by defining separate waypoints (=GIS points) that force your trucks to use route A or B.

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • ok thanks But I have to decide trucks How can I? By writing Java code؟ Can you suggest me a resource? thanks for your response – javad karimian Dec 14 '16 at 21:10