vcTransportSystem

Transport system is a management and query service for vcTransportNode and vcTransportLink objects that form a transportation graph. It is owned by a vcProcessController.

 

Properties

Name Type Access Description
ProcessController vcProcessController R Parent controller that owns this system.
Nodes List of vcTransportNode R Gets all transport nodes associated with this system.
Links List of vcTransportLink R

Gets all transport links owned by this system.

Controllers List of vcTransportController R

Gets all available transport controllers. Includes both system and user-implemented controllers.

Methods

Name Return Type Parameters Description
createTransportLink vcTransportLink

vcTransportNode source, vcTransportNode destination, vcTransportController implementer, vcProcessFlowGroup group

Creates a new transport link from source to destination node and registers it to the system. Source and destination have to be in this transport system and cannot be the same.

deleteTransportLink None vcTransportLink link

Removes the given link from this system and deletes it.

createTransportSolution vcTransportSolution -

Creates an empty transport solution.

findSolution vcTransportSolution

vcTransportNode source, vcTransportNode destination, vcProcessFlowGroup flowGroup

Tries to find a valid route from source to destination, only considers links that support the given flow group. The route isn’t optimized.

Returns None if a valid route doesn’t exist.

findAllLinksBetweenNodeSets List of vcTransportLink

List of vcTransportNode sourceNodes, List of vcTransportNode destinationNodes, vcProcessFlowGroup group

Finds a set containing all links that are part of any valid path from any node in sourceNodes set to any node in the destinationNodes set. This can be used to e.g. check navigability between all implementations of two processes.

The source and destination node sets can overlap.

Only considers transport links that support the given flow group.

Events

Name Parameters Description
OnTransportControllerAdded vcTransportController controller

Event that occurs when a new transport controller has become available.

OnTransportControllerRemoving vcTransportController controller

Event that occurs when a transport controller is being removed.

OnTransportNodeAdded vcTransportNode node

Event that occurs when a new transport node has been added to this system.

OnTransportNodeRemoving vcTransportNode node

Event that occurs when the transport node is being removed from this system.

OnTransportLinkAdded vcTransportLink link

Event that occurs when a new transport link has been created to this system.

OnTransportLinkRemoving

vcTransportLink link

Event that occurs when a transport link is being deleted.

OnTransportLinkRemoved vcProcessFlowGroup group, vcTransportNode source, vcTransportNode destination

Event that occurs when a transport link has been deleted.

Examples

Example. Create a new Transport Link.

from vcScript import *
app = getApplication()
sim = getSimulation()
process_controller = sim.ProcessController
transport_system = process_controller.TransportSystem
nodes = transport_system.Nodes
for n in nodes:
  print n.Parent.Name
# Get the handle for human transport controller
human_transport_controller = app.findComponent('Human Transport Controller')
human_tc = human_transport_controller.findBehavioursByType(VC_PYTHONTRANSPORTCONTROLLER)[0]
# Get the handle for product flow groups
flow_grp_mgr = process_controller.FlowGroupManager
flow_groups = flow_grp_mgr.Groups
flow_group1 = flow_groups[0]
# Create a new Transport Link
new_link = transport_system.createTransportLink(nodes[0], nodes[-1], human_tc, flow_group1)
# Event handler when a Transport Link is removed
def link_removed_handler(link):
  print 'Transport link removed between', link.Source.Parent.Name, 'and', link.Destination.Parent.Name
transport_system.OnTransportLinkRemoving = link_removed_handler