Views:

Question

How to create a flow bundle based upon a PuT assignment by using COM, using conditions restricting ?

Answer

Example:

 

aFlowBundlePuT = Visum.Net.FlowBundle
aFlowBundlePuT.Clear()
aFlowBundlePuT.DemandSegments = "PT"

 

aStopPoint1 = Visum.Net.StopPoints.ItemByKey(442)
aStopPoint2 = Visum.Net.StopPoints.ItemByKey(66)

 

anActivityTypeSet1 = aFlowBundlePuT.CreateActivityTypeSet()
anActivityTypeSet1.Add(16) # Transfers
anActivityTypeSet1.Add(32) # PassThroughStop
anActivityTypeSet1.Add(64) # PassThroughNoStop

 

aNetElms1 = Visum.CreateNetElements()
aNetElms1.Add Visum.Net.Lines.ItemByKey("B36")
aFlowBundlePuT.CreateConditionWithRestrictedSupply(aStopPoint1, aNetElms1, True, anActivityTypeSet1, aNetElms1, True)

 

anActivityTypeSet2 = aFlowBundlePuT.CreateActivityTypeSet()
anActivityTypeSet2.Add(4) # Boarding passengers
anActivityTypeSet2.Add(8) # Alighting passengers
anActivityTypeSet2.Add(16) # Transfers
anActivityTypeSet2.Add(32) # PassThroughStop
anActivityTypeSet2.Add(64) # PassThroughNoStop

 

aNetElms2 = Visum.CreateNetElements()
aFlowBundlePuT.CreateConditionWithRestrictedSupply(aStopPoint2, aNetElms2, False, anActivityTypeSet2)

 

aFlowBundlePuT.ExecuteCurrentConditions()