The Model
We'll use the following model to show how the A* Navigator can be used in a simple model. The real power of the A* Module is to layout very large and complex models that would require large network node layouts to handle all of the TaskExecuters.
Create the Navigator
First, an AStarNavigator object must be added to the model. Only one AStarNavigator object is available per model.
- Create an AStarNavigator object by click and dragging from the Library to somewhere in the 3D view.
Connecting Members
In this model, there is only one TaskExecuter object, however, we also want to include the Rack as a barrier.
- Make an 'A' connection between the AStarNavigator and the Operator. This can be done by holding the 'A' key down and clicking and dragging from the AStarNavigator to the Operator, or from the Operator to the AStarNavigator. A blue circle will appear below the Operator.
- Make an 'A' connection between the AStarNavigator and the Rack. A blue rectangle should will below the Operator.
Creating Barriers
Along with the Rack, we will also create a couple of barriers to represent walls or obstacles that the operator cannot walk through.
- Click on the Divider icon in the Library to enter create mode.
- Click somewhere to the right of the Queue to create a new divider.
- Click twice more near the points shown in the image below to finish the divider.
- Right-click to exit create mode.
- Click on the Barrier icon in the Library to enter create mode.
- Click once where the lower left corner of the barrier will be as shown below.
- Click again in the upper right hand corner to complete the barrier.
- Right-click to exit create mode.
Run the Model
You can now reset and run the model to see how the operator performs. Remember, if you make any changes to your barriers the model must be reset before running.
Notice that the operator found that the shortest path is to move up and over our divider. Though there are multiple ways to alter the operator's path (for instance making the divider extend out further) we will modify the operator's path through a Preferred Path.
Create Preferred Paths
Preferred paths are not 'set' paths, rather they give the nodes associated with the preferred path a greater weight in the search algorithm. This will in affect, pull the operator toward the preferred path.
- Click on the Preferred Path icon in the Library to enter create mode.
- Create the following two preferred paths shown in the image below. Preferred paths are one-directional and thus must be laid out in the correct order.
- Right-click to exit create mode.
Run the Model
Reset and run the model.
If your operator continues to move up and over the divider, you can either move the preferred path or you can change the preferred path weight in the AStarNavigator object's properties window.
Results of your model may vary from this example as placement of barriers and objects will make a difference in the calculated paths of the operator.