Visual Components' Community

New Thinking for Factory Simulation
Welcome to Visual Components' Community Sign in | Help
in Search

Routing and its cusotmization

Last post to, marras 20 2008 11:53 by Manuela. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • to, marras 20 2008 11:53

    • Manuela
    • Top 10 Contributor
    • Joined on pe, helmi 22 2008
    • Posts 75

    Routing and its cusotmization

    Part routing at simulation

    Parts moving in the simulation can be sent to different directions using the routing behaviour of a component.
    Routing behaviour uses input and output connectors from where parts can come into the component and leave from component.
    At simplest users chooses the connector name/number from routing property combobox. This defines fixed routing so that all components leave using the same connector.
    In the more complex situation the user can use rules to distribute parts to leave from different outputs based on the product type, the load at connected components, using statistical percentage etc.


    In some cases it might be still required to customize routing because the user applications has special requirements. This customization can be done using typically two approaches:


    a)    Custom scripting without routing

    This mechanism is used if end user does not need to change the routing decision from component parameters and if routing decision is bases on  complex decisions.
    b)    Overriding routing behaviours decisions with custom event
    This mechanism allows overriding routing decisions in all cases or in the selected cases.


    Example :Create geometry and frames

    Example component is a simple box which has at each four sides a interface where other components can be connected. In this case we assume that one of interfaces defines input and tree other sides are outputs.
    In order to make it easier to add interfacing, we create four frame features for the box using following names:
    - Input (Rotate frame X axis to go into the box)
    - OutputDirect (Rotate frame X axis to go out from the box)
    - OutputRight (Rotate frame X axis to go out from the box)
    - OutputLeft (Rotate frame X axis to go out from the box)


    Add Routing behaviour

    Next we will add routing rule behavior using name "Routing". In the routing rule we need to define the connectors to match all four routing choices by adding following connectors in the routing behavior "Connections" editing (connectors are added by using right mouse popup menu at the top of connections listview) :
    - Input (Connection Attributes: "Input" checked)
    - OutputDirect (Connection Attributes: "Output" checked)
    - OutputRight (Connection Attributes: "Output" checked)
    - OutputLeft (Connection Attributes: "Output" checked)

    routing dialog

    Add interfaces

    Next add (One to One interface behaviours) four interfaces to allow the connecting of other components to different sides of the box:
    - Input (Interface sections > section Frame = "Input", Section fields > Flow Field > Container = "Routing", Port = "Input")
    - OutputDirect (Interface sections > section Frame = "OutputDirect", Section fields > Flow Field > Container = "Routing", Port = "OutputDirect")
    - OutputRight (Interface sections > section Frame = "OutputRight", Section fields > Flow Field > Container = "Routing", Port = "OutputRight")
    - OutputLeft (Interface sections > section Frame = "OutputLeft", Section fields > Flow Field > Container = "Routing", Port = "OutputLeft")

     add interfaces

    Test component

    Now we have a working component where the end user can use component routing parameter to define at what directions part(s) should go.
    In order to test component plug&play four conveyors to each side of the component and add a component creator before the first "input" conveyor.

    Test routing model

    Change routing
    Now routing can be tested by changing the routing rule from component parameters tab page.

    change routing

    Overriding routing decisions with scripting

    The next part explains how routing decision can be customized when part have a special name. In other cases part routing will use the rule or fixed destination what the user has defined in the the component "routing" parameter.
    In order to customize routing it is necessary to add a python script with the following content (please ensure to follow the correct intendation):

     Python script

    In the script the "DoCustomRouting" method is called every time when a part enters into the routing behaviour and a routing decision needs to be made.
    This custom method can then override routing decision by using "setTarget" method for routing behaviour. If this method is not called, then routing uses the default routing rule.

    Test Custom routing

    In order to test custom routing, stop simulation in a middle of run and select part before it enters to routing component, change its name to “special” and continue simulation.

     Final routing

    Change selected part name to “special” to see the effect. Now you will see that part with “special” name will be routed differently.

Page 1 of 1 (1 items)