Path finding
Last updated
Last updated
In automation systems, material flow strategies are often very important for throughput and very often simulation models are created to develop and optimize these strategies. Our library is open and extensible and you can implement your own strategies.
automatically enter the next path if the end of the current path is connected to another path. If no path is connected, the will normally stop at the end of the current (unconnected) path. If the Exit Path property of the is set to true, the will exit the path and be automatically controlled by physics.
If there is more than one successor for a path, the TryMoveNext public method is called in the . The following sequence of strategies is invoked:
Step 1: Check the SelectNextPath methods of the components on the Path Mover.
First, all components on the that implement the ISelectNextPath interface are selected. In all components, the SelectNextPath method is called with a reference to a list (in the Path Mover) of all successor paths.
The implemented method SelectNextPath is able to remove paths from the list (so that this path is not taken as the next successor for sure) or to reorder the list so that a certain path is at the first position in the list.
** Step 2: Checking the PathStratey referenced by Path**.
The next step is to check if the path has an assigned PathStrategy. If not, we proceed to step 3. The PathStrategy is a reference to a component that inherits from PathStrategy. In a PathStrategy, the public method SelectNextPath must be implemented.
** Step 3: Check the SelectNextPath methods of components on the path itself**.
Next, call all components on the path itself that implement the ISelectNextPath interface. You will get the remaining list of successors from step2 (or a complete list of successors if no logic was found in step1)
** Step 4: Select remaining path and move MU to next path**.
Now the remaining list of NextPaths is taken. If there is no content left because the strategies have removed all successor paths, nothing happens. Otherwise, the first path in the list is taken and the is moved to the next path.
This pictures shows the overall logic of path finding:
You can implement your own strategies for selecting the next path. The only thing you need to do is to create a script that implements the interface ISelectNextPath.
The strategy itself looks like this:
Another way to define custom strategies is to reference a component in the path itself that inherits from PathStrategy. Here is an example of a strategy that limits the number in a given range.
If you delete all from the NextPaths list in your logic, the will stop at the end of the current path. As soon as something changes in your system that could make the path strategy successful, you need to call TryMoveNext in the blocked . You can see this in the example in Option2 below.
Here is an example from the DemoPathsystem_UseCases demonstration model. The StrategyRandom randomly selects the next path. It is attached as a component to the :
The SelectNextPath method is called from the located at the end of a path. If the current number in the range is greater than the allowed number, the list of paths is cleared. As a result, the is stopped. The waiting is added to the blocked list by calling AddBlocked.
During startup, event listeners are added on all paths entering or exiting the scope, referencing the OnPathExit or OnPathEntered methods. During simulation, these methods increment or decrement the counter. If the count is below the defined threshold, AwakeBlocked is called. AwakeBlocked is implemented in the PathStrategy base class. It calls TryMoveNext in all blocked .
© 2022 in2Sight GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.