By default, an item follows its own flow paths as it moves through a Planimate® system model.
To make an Item use a Track Object, the item is assigned a “Route” to follow.
A “Route” is a list of locations that are to be visited in turn, by travelling along Tracks instead of Item Flow Paths.
Before using a Track, the item looks up the defined Track Network Details table to determine how long it is to take travelling across each Track “section".
- 1 Route Specification and Assignment
- 2 Manual Route Specification and Assignment
- 3 Route Specification within a Routine
Route Specification and Assignment
Routes can be specified either by hand, or dynamically using the routines in a change object.
A route is assigned by passing the item through a change object. The train item is then “delivered” up to a track object by being sent out a portal exit within the first location specified in that route.
There are two methods of specifying and assigning routes onto a train item - each is straightforward.
Each method has aspects that might make you favour its use.
Manual Route Specification and Assignment
Manual Route Specification
How to Specify a Route manually:
- Select the Routes option in the Track menu in the Menu bar.
- Click on the Add New Route option.
- Enter a name for the Route.
A menu appears for input of the details used by the trains for their Route.
- Select Edit Steps from the Menu.
- Click on the Add button in the list box that pops up.
- Specify the step of the Route by clicking on a Portal.
NB: ALWAYS BEGIN WITH THE PORTAL FROM WHICH THE TRAIN WILL EMERGE.
- Repeat 5) and 6) to add steps to the Route until it is complete.
The last portal in the Route will be the last location the train item will attempt to reach by travelling along a Track Object. This location need not necessarily be the same portal from which the Route began.
After entering this portal, the route is completed and the Train no longer has a route.
Points to Note:
- If there is a great deal of duplication the copy button permits the details of a previously entered trip to be copied into the new trip.
- The maximum number of steps in a route is limited to 512.
Guess Intermediate Steps
Manually-created Routes do not need to include every portal to be passed through for the route.
By Default, a route will “Guess Intermediate Steps” between the portals included in it. You will need to include enough portal or loop locations in the Route specification so that the track path between these is unambiguous.
Guess Intermediate Steps is an option for a route. If it is turned off then all portals must be included in the route sequence, including the one from which the train emerges at the start of the Route.
Manual Route Assignment
A Route can be manually assigned using the Route option in the change object.
The Route Assignment Dialog displays a list of all of the Routes that you have specified in your model.
There is only one List of Routes available in the Model, so each Route has a unique index number.
Below this list, you then specify a "Selector Reference" Attribute. This provides a value for which a matching Route index value is sought.
If a route's index value matches the value of this Selector Reference Attribute when an item passes through the Change Object, then the item will be assigned the corresponding Route.
NB: You can set the Selector Reference attribute to a constant number to get a single trip from this list happening simply to begin with.
Selector Reference is an Attribute
Because the Selector Reference is an Attribute, you can point to an attribute that varies during a model run.
e.g. You can create an Item Attribute called "Trip_Name". Each item can be given a different trip_name value, and each item will be assigned a different Route when it passes through this change object.
Selector Reference Enables Multiple Choices
The Selector Reference can be pointed to a Table. This enables a number of routes to be specified and they will be tested sequentially, with the first "accepting" route taken by an item.
- The reference must be to the entire table.
- The route index values to test are specified in column 1 of the table.
- The rows in this column should be set to the route IDs to test.
An additional "row limit" attribute can be set.
This provides a convenient means of limiting the number of rows tested.
This is useful because the table needs to be prepared and available during lookahead, during which time rows cannot be added/ removed from a table.
The default of -1 for the row limit will scan all rows in the table.
Route Specification within a Routine
You can specify, alter, assign and read train item routes using routine operations and tables.
To manipulate routes you need a table with a single column tuple of “_location”, formatted to the “_Model Objects” label list.
Use appropriate routine operations to add location names to this table and create the route specification.
Then, use the “AssignRoute” routine operation to place the route specification on to the train item passing through the routine.
You can also read the route specification carried by the train into this table, with the “ReadRoute” operation.
Various other route operations are available to assist with reading and manipulation of route information on a train item:
- Sets an item's track route from a table
- Reads an item's track route into a table
- Fills in all intermediate portals in an item's track route.
- This is very useful as you can then use the "route read" operation to read the completed route back into a table and use the table data to perform any further condition checking, iterations or manipulations and if desired, re-assign it as a route to the item.
- Insert a track route step into an item's internal routing database
- Clear an item's routing database