Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

SKIM MATRICE RASTOJANJA I VREMENA PUTOVANJA

# ================================================== #
# OmniTRANS Lecturer Pack - Create distance skim #
# ================================================== #
# The purpose of this job is to calculate a skim #
# matrix with distance values for all OD-pairs. #
# This matrix can later be used for the purpose of #
# trip distribution. #
# ================================================== #

# OmniTRANS' internal OtTraffic class is used to perform the calculation


createSkimCalculator = OtTraffic.new()

# The .network property is used to define the mode and time combination
# for which the skim is generated. This is set using a parameter
createSkimCalculator.network = [10,1]

# The .skimFactors and .skimMatrix properties are used to define the


# type of skim matrices that will be generated (cost, distance, time).
# These properties are set by using a parameter
createSkimCalculator.skimFactors = [0,1,60]
createSkimCalculator.skimMatrix = [1,10,1,1,[0,12,13],1]

# Now all relevant properties are set, we can run the model
createSkimCalculator.execute()

# Intrazonal distances by default are set to 0


# As we want no intrazonal trips, we manually adjust the
# values for intrazonal in the skim to a high value

# Open skim cube


sc = OtSkimCube.open()

# Obtain matrix from the cube


skimMatrix = sc.get([1,10,1,1,12,1])

# Set the intrazonal values to 0.5


intraZonalValues = skimMatrix.intra
intraZonalValues[] = 0.5
skimMatrix.intra = intraZonalValues

# Save the matrix in the cube


sc.set([1,10,1,1,12,1],skimMatrix)
NASTAJANJE PUTOVANJA

# ================================================== #
# OmniTRANS Lecturer Pack - Trip generation #
# ================================================== #
# The purpose of this job is to calculate total trip #
# production and attraction numbers per zone, based #
# on trip generation functions derived from linear #
# regression analysis. #
# ================================================== #

# OmniTRANS' internal OtTripEnd class is used to perform the calculation


tripEndCalculator = OtTripEnd.new()

# The .combinations property is used to determine the relevant dimensions. The used parameters are
predefined
tripEndCalculator.combinations = [[PR_Produkcija, A_Atrakcija]]

# The .functionSpec property is used to define the regression functions. These are parameters that need
to be set.
tripEndCalculator.functionSpec = ["xxx*relativna_produkcija","xxx*relativna_atrakcija"]

# Now all relevant properties are set, we can run the model
tripEndCalculator.execute()
GRAVITACIONI MODEL

# ================================================== #
# OmniTRANS Lecturer Pack - Trip distribution model #
# ================================================== #
# The purpose of this job is to create a trip matrix #
# with trip numbers per OD-pair, using a gravity #
# model. #
# ================================================== #

# OmniTRANS' internal OtGravity class is used to perform the calculation


distributionCalculator = OtGravity.new()

# The .skimMatrix property is used to define the PMTURI dimensions of the


# distance matrix. This property is set by using a parameter
distributionCalculator.skimMatrix = [1,10,1,1,12,1]

# The .functionType and .functionSpec properties define the deterrence function


# For this (unimodal private) exercise, we have predefined the function and its
# parameters
distributionCalculator.functionType = TOPLOGNORMAL
distributionCalculator.functionSpec = [0.5,-0.7,5]

# The .iterations property is used to define the number of Furness steps.


# This property is set by using a parameter
distributionCalculator.iterations = 10

# The .odMatrix property is used to define the PMTU dimensions of the


# resulting travel demand matrix. This property is set by using a parameter.
distributionCalculator.odMatrix = [1,1,1,1]

# Now all relevant properties are set, we can run the model
distributionCalculator.execute()
RASPODELA TOKOVA NA MREŽU - METODA “SVE ILI NIŠTA”

# ================================================== #
# OmniTRANS Lecturer Pack - Template for assignment #
# ================================================== #
# This job is a template job that inclued many of #
# the properties of the OtTraffic class. It can be #
# used to define new jobs and determine what proper- #
# ties are relevant. #
# ================================================== #

# IMPORTANT:
# If a property is not relevant for your assignment, comment out that line of code using a # symbol

# OmniTRANS' internal OtTraffic class is used to perform the calculation


assignmentCalculator = OtTraffic.new()

# The .assignMethod property defines the type of assignment


assignmentCalculator.assignMethod = ALLORNOTHING

# The .network property is used to define the mode and time combination
# for which the assignment is performed. This is set using a parameter
assignmentCalculator.network = [10,1]

# The .odMatrix property defines the PMTU dimensions of the travel demand
# matrix that is to be assigned
assignmentCalculator.odMatrix = [1,10,1,1]

# The .load property defines the PMTURI dimensions where the resulting
# linkloads are stored. Note that this property should have a different
# value per assignmethod to match your project dimensions
assignmentCalculator.load = [1,10,1,1,2,1]

# Now all relevant properties are set, we can run the model
assignmentCalculator.execute()
RASPODELA TOKOVA NA MREŽU - METODA KAPACITETNOG OGRANIČENJA

# ================================================== #
# OmniTRANS Lecturer Pack - Template for assignment #
# ================================================== #
# This job is a template job that inclued many of #
# the properties of the OtTraffic class. It can be #
# used to define new jobs and determine what proper- #
# ties are relevant. #
# ================================================== #

# IMPORTANT:
# If a property is not relevant for your assignment, comment out that line of code using a # symbol

# OmniTRANS' internal OtTraffic class is used to perform the calculation


assignmentCalculator = OtTraffic.new()

# The .assignMethod property defines the type of assignment


assignmentCalculator.assignMethod = VOLUMEAVERAGING

# The .network property is used to define the mode and time combination
# for which the assignment is performed. This is set using a parameter
assignmentCalculator.network = [10,1]

# The .odMatrix property defines the PMTU dimensions of the travel demand
# matrix that is to be assigned
assignmentCalculator.odMatrix = [1,10,1,1]

# The .load property defines the PMTURI dimensions where the resulting
# linkloads are stored. Note that this property should have a different
# value per assignmethod to match your project dimensions
assignmentCalculator.load = [1,10,1,1,3,1]

# For stochastic assignments, the following properties can be used.


assignmentCalculator.seed = 4801
assignmentCalculator.spread = 0.1

# The number of iterations and convergence are controlled by the following


# properties. Also you can define to save intermediate results
assignmentCalculator.epsilon = 0.1
assignmentCalculator.iterations = 10
assignmentCalculator.saveIterations = false

# Travel time functions can be entered in mutliple ways, for example


# BPR functions are set using
assignmentCalculator.bprPerType = [[0,[0.87,4.0]]]

# Now all relevant properties are set, we can run the model
assignmentCalculator.execute()

You might also like