Type and functions

TransComp.EmissionLimitbymodeType
EmissionLimitbymode

An 'EmissionLimitbymode' describes emissions constrained for a mode.

Fields

  • id::Int: unique identifier of the emission constraint
  • mode::Mode: mode of transport
  • emission::Float64: emission constraint of the vehicle type (tCO2/year)
  • year::Int: year of the expected emission constraint
source
TransComp.EmissionLimitbyyearType
EmissionLimitbyyear

An 'EmissionLimitbyyear' describes an emission goal for a specific year for the total emissions.

Fields

  • id::Int: unique identifier of the emission constraint
  • emission::Float64: emission constraint
  • year::Int: year of the expected emission constraint
source
TransComp.FinancialStatusType
FinancialStatus

A 'FinancialStatus' describes a demographic group based on what there average budget for transportation-related expenses is.

Fields

  • id::Int: unique identifier of the financial status
  • name::String: name of the financial status
  • VoT: value of time in €/h
  • monetary_budget_purchase: budget for purchasing costs in €/year
  • monetary_budget_purchase_lb: lower bound of the budget for purchasing costs in €/year
  • monetary_budget_purchase_ub: upper bound of the budget for purchasing costs in €/year
  • monetary_budget_purchase_time_horizon: time horizon of the budget for purchasing costs in years, indicating the time period over which the budget is valid
source
TransComp.FuelType
Fuel

A 'Fuel' represents the energy source used for the vehicle propulsion.

Fields

  • id::Int: unique identifier of the fuel
  • name::String: name of the fuel
  • emission_factor::Float64: emission factor of the fuel in gCO2/kWh
  • cost_per_kWh: cost per kWh of the fuel in €
  • cost_per_kW: cost per kW of the fuel in €
  • fueling_infrastructure_om_costs::Array{Float64,1}: fueling infrastructure operation and maintenance costs in €/year
source
TransComp.GeographicElementType
GeographicElement

A 'Graph_item' represents a graph item that is either a node or an edge.

Fields

  • id::Int: unique identifier of the graph item
  • type::String: type of the graph item (either 'node' or 'edge')
  • name::String: name of the graph item
  • carbon_price::Array{Float64,1}: carbon price in €/tCO2 for each year
  • from::Node: the node from which the edge starts
  • to::Node: the node to which the edge ends
  • length::Float64: length of the connection in km
source
TransComp.InitDetourTimeType
InitDetourTimes

An 'InitDetourTimes' represents the detour times that exist at the initial year of the optimization horizon. It is the average detour time to reach a fueling station.

Fields

  • id::Int: unique identifier of the initial detour times
  • fuel::Fuel: fuel type of the fueling station
  • location::GeographicElement: location of the fueling station
  • detour_time::Float64: detour time in h
source
TransComp.InitialFuelingInfrType
InitialFuelingInfr

An 'InitialFuelingInfr' represents the fueling infrastructure that exists at the initial year of the optimization horizon.

Fields

  • id::Int: unique identifier of the initial fueling infrastructure
  • technology::Technology: technology of the fueling infrastructure
  • allocation: allocation of the fueling infrastructure
  • installed_kW::Float64: installed capacity of the fueling infrastructure in kW
source
TransComp.InitialModeInfrType
InitialModeInfr

An 'InitialModeInfr' represents the mode infrastructure that exists at the initial year of the optimization horizon.

Fields

  • id::Int: unique identifier of the initial mode infrastructure
  • mode::Mode: mode of transport
  • allocation: allocation of the mode infrastructure
  • installed_ukm::Float64: installed transport capacity of the mode infrastructure in Ukm
source
TransComp.InitialSupplyInfrType
InitialSupplyInfr

An 'InitialSupplyInfr' represents the supply infrastructure that exists at the initial year of the optimization horizon.

Fields

  • id::Int: unique identifier of the initial supply infrastructure
  • fuel::Fuel: fuel type of the supply infrastructure
  • allocation: allocation of the supply infrastructure
  • installed_kW::Float64: installed capacity of the supply infrastructure in kW
source
TransComp.InitialVehicleStockType
InitialVehicleStock

An 'InitialVehicleStock' represents a vehicle fleet that exisits at the initial year of the optimization horizon.

Fields

  • id::Int: unique identifier of the initial vehicle stock
  • techvehicle::TechVehicle: vehicle type and technology of the vehicle
  • year_of_purchase::Int: year in which the vehicle was purchased
  • stock::Float64: number of vehicles of this type in the initial vehicle stock
source
TransComp.ModeType
Mode

A 'Mode' represents a transport mode. Transport modes may differ either by the infrastructure used (for example, road vs. rail) or by the used vehicle type (for example, private passenger car vs. bus) that directly influences the travel time but excludes a differentiation based on technology.

Fields

  • id::Int: unique identifier of the mode
  • name::String: name of the mode
  • quantify_by_vehs::Bool: if for this mode vehicles stock is sized or not. If this mode is considered with levelized costs, including the costs for vehicles and related costs.
  • cost_per_ukm::Array{Float64, 1}: cost per km in €/km (only relevant when quantifybyvehs is false)
  • emission_factor::Array{Float64,1}: emission factor of the mode in gCO2/ukm (only relevant when quantifybyvehs is false)
  • infrastructure_expansion_costs::Array{Float64,1}: infrastructure expansion costs in € (only relevant when quantifybyvehs is false)
  • infrastructure_om_costs::Array{Float64,1}: infrastructure operation and maintenance costs in €/year (only relevant when quantifybyvehs is false)
  • waiting_time::Array{Float64,1}: waiting time in h
source
TransComp.ModeSharemaxbyyearType
ModeSharemaxbyyear

Maximum mode shares of a transport mode in a specific year.

Fields

  • id::Int: unique identifier of the mode share
  • mode::Mode: mode of transport
  • share::Float64: maximum share of the mode
  • year::Int: year of the maximum mode share
  • region_type::Array{Regiontype,1}: array of region types that are affected by this TechVehicle share constraint
source
TransComp.ModeShareminbyyearType
ModeShareminbyyear

Minimum mode shares of a transport mode in a specific year.

Fields

  • id::Int: unique identifier of the mode share
  • mode::Mode: mode of transport
  • share::Float64: minimum share of the mode
  • year::Int: year of the minimum mode share
  • region_type::Array{Regiontype,1}: array of region types that are affected by this TechVehicle share constraint
source
TransComp.OdpairType
Odpair

An 'Odpair' describes transport demand. It may take place between two regions but origin and destination may al so

Fields

  • id::Int: unique identifier of the odpair
  • origin::Node: origin of the transport demand
  • destination::Node: destination of the transport demand
  • paths::Array{Path, 1}: possible paths between origin and destination
  • F: number of trips in p/year or t/year
  • product::Product: product that is transported
  • vehicle_stock_init::Array{InitialVehicleStock,1}: initial vehicle stock
  • financial_status::FinancialStatus: financial status of the transport demand
  • region_type::Regiontype: region type of the transport demand
  • travel_time_budget::Float64: travel time budget in h/year
source
TransComp.PathType
Path

A 'Path' represents a possible route between two nodes. This sequence includes the nodes that are passed through and the length of the path.

Fields

  • id::Int: unique identifier of the path
  • name::String: name of the path
  • length::Float64: length of the path in km
  • sequence: sequence of nodes and edges that are passed through
source
TransComp.ProductType
Product

A 'Product' represents either a good or a service that is being transported. This may include passengers, or different types of products in the freight transport. The differentiation of transported products related to the different needs for transportation and, therefore, different possible sets of transport modes, vehicle types and drivetrain technologies are available for transport.

Fields

  • id::Int: unique identifier of the product
  • name::String: name of the product
source
TransComp.RegiontypeType
Regiontype

A 'Regiontype' describes a region based on its characteristics that induces differences in transportation needs (for example, urban vs. rural area).

Fields

  • id::Int: unique identifier of the regiontype
  • name::String: name of the regiontype
  • speed::Float64: average speed in km/h
  • costs_var::Array{Float64, 1}: variable costs in €/vehicle-km
  • costs_fix::Array{Float64, 1}: fixed costs in €/year
source
TransComp.SupplyTypeType
SupplyType

A 'SupplyType' represents the type of supply infrastructure that is used for fueling vehicles.

Fields

  • id::Int: unique identifier of the supply type
  • name::String: name of the supply type
  • fuel::Fuel: fuel type of the supply infrastructure
  • install_costs::Array{Float64}: installation costs in €
  • om_costs::Array{Float64}: operation and maintenance costs in €/year
source
TransComp.TechVehicleType
TechVehicle

A 'TechVehicle' represents a vehicle that is used for transportation. This includes the vehicle type, the technology used in the vehicle, the capital and maintenance costs, the load capacity, the specific consumption, the lifetime, the annual range, the number of vehicles of this type, the battery capacity, and the peak charging power.

Fields

  • id::Int: unique identifier of the vehicle
  • name::String: name of the vehicle
  • vehicle_type::Vehicletype: type of the vehicle
  • technology::Technology: technology used in the vehicle
  • capital_cost::Array{Float64}: capital cost in €
  • maintenance_cost_annual::Array{Array{Float64,1},1}: annual maintenance cost in €/year
  • maintenance_cost_distance::Array{Array{Float64,1},1}: maintenance cost per km in €/km
  • W::Array{Float64}: load capacity in t
  • spec_cons::Array{Float64}: specific consumption in kWh/km
  • Lifetime::Array{Int}: lifetime of the vehicle in years
  • AnnualRange::Array{Float64}: annual range in km
  • products::Array{Product}: number of vehicles of this type
  • tank_capacity::Array{Float64}: battery capacity in kWh
  • peak_fueling::Array{Float64}: peak charging power in kW
  • fueling_time´::Array{Float64}: refueling time in h (total tank) - array with values by generation
source
TransComp.TechnologyType
Technology

A 'Technology' represents the drivetrain technology used in the vehicle.

Fields

  • id::Int: unique identifier of the technology
  • name::String: name of the technology
  • fuel::Fuel: fuel used by the technology
source
TransComp.VehicleSubsidyType
VehicleSubsidy

A 'VehicleSubsidy' describes the subsidy for a vehicle type in a specific year.

Fields

  • id::Int: unique identifier of the subsidy
  • name::String: name of the subsidy
  • years::Array{Int,1}: years in which the subsidy is valid
  • techvehicle::TechVehicle: vehicle type and technology
  • subsidy::Float64: subsidy in €
source
TransComp.VehicletypeType
Vehicletype

A 'Vehicletype' represents a type of vehicle that is used for transportation. This may be for example, small passenger cars, buses, or light-duty trucks.

Fields

  • id::Int: unique identifier of the vehicle type
  • name::String: name of the vehicle type
  • mode::Mode: mode of transport that the vehicle type is used for
  • product::Product: product that the vehicle type is used for
source
TransComp.base_define_variablesMethod
base_define_variables(model::Model, data_structures::Dict)

Defines the variables for the model.

Arguments

  • model::Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.check_correct_format_FuelMethod
check_correct_format_Fuel(data_structures::Dict, years)

Check if the format of the Fuel entries is correct.

Arguments

  • data_structures::Dict: The input data.
  • years::Int: The number of years in the optimization horizon.
source
TransComp.check_correct_format_ModeMethod
check_correct_format_Mode(data_structures::Dict, years)

Check if the format of the Mode entries is correct.

Arguments

  • data_structures::Dict: The input data.
  • years::Int: The number of years in the optimization horizon.
source
TransComp.check_correct_format_OdpairMethod
check_correct_format_Odpair(data_structures::Dict)

Check if the format of the Odpair entries is correct.

Arguments

  • data_structures::Dict: The input data.
  • years::Int: The number of years in the optimization horizon.
source
TransComp.check_correct_formats_GeographicElementMethod
check_correct_formats_GeographicElement(data_structures::Dict, years)

Check if the format of the GeographicElement entries is correct.

Arguments

  • data_structures::Dict: The input data.
  • years::Int: The number of years in the optimization horizon.
source
TransComp.check_folder_writableMethod
check_folder_writable(folder_path::String)

Check if the folder exists and can be written in.

Arguments

  • folder_path::String: The path to the folder.
source
TransComp.check_input_fileMethod
check_input_file(path_to_source_file::String)

Check if the input file exists and is a YAML file.

Arguments

  • path_to_source_file::String: The path to the input file.
source
TransComp.check_model_parametrizationMethod
check_model_parametrization(data_dict::Dict, required_keys::Vector{String})

Check if the required keys are present in the model data.

Arguments

  • data_dict::Dict: The input data.

Returns

  • Bool: True if the required keys are present, false otherwise.
source
TransComp.check_required_keysMethod
check_required_keys(data_dict::Dict, required_keys::Vector{String})

Check if the required keys are present in the input data.

Arguments

  • data_dict::Dict: The input data.
source
TransComp.check_required_sub_keysMethod
check_required_sub_keys(data_dict::Dict, required_keys::Vector{String}, parent_key::String)

Check if the keys are defined for a parent key in the input data.

source
TransComp.check_uniquness_of_idsMethod
check_uniquness_of_ids(data_structures::Dict, required_keys::Vector{String})

Checks if all "id" entries in a list of dictionaries are unique.

Arguments

  • data_structures::Dict: The input data.
  • required_keys::Vector{String}: The keys to check for uniqueness.
source
TransComp.constraint_demand_coverageMethod
constraint_demand_coverage(model::JuMP.Model, data_structures::Dict)

Creates constraint for demand coverage.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_emissions_by_modeMethod
constraint_emissions_by_mode(model::JuMP.Model, data_structures::Dict)

Emissions given per mode for a specific year. Attention: This constraint may be a source for infeasibility if mode or technology shift cannot be achieved due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf), or due to the lifetimes of technologies as well as the lack of available low emission or zero emission technologies.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_fueling_demandMethod
constraint_fueling_demand(model::JuMP.Model, data_structures::Dict)

Constraints for fueling demand at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_fueling_infrastructureMethod
constraint_vehicle_purchase(model::JuMP.Model, data_structures::Dict)

Constraints for the sizing of fueling infrastructure at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_market_shareMethod
constraint_market_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific vehicle types, this function will create constraints for the newly bought vehicle share of vehicles the modes.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_max_mode_shareMethod
constraint_max_mode_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific modes, this function will create constraints for the share of the modes. When this constraint is active, it can be a source of infeasibility for the model as it may be not possible to reach certain mode shares due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf). Or when multiple constraints for the mode share are active.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_min_mode_shareMethod
constraint_min_mode_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific modes, this function will create constraints for the share of the modes. When this constraint is active, it can be a source of infeasibility for the model as it may be not possible to reach certain mode shares due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf). Or when multiple constraints for the mode share are active.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_mode_infrastructureMethod

constraintmodeinfrastructure(model::JuMP.Model, data_structures::Dict)

Constraints for sizing of mode infrastructure at nodes and edges.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_mode_shareMethod
constraint_mode_share(model::JuMP.Model, data_structures::Dict)

If share are given for specific modes, this function will create constraints for the share of the modes. When this constraint is active, it can be a source of infeasibility for the model as it may be not possible to reach certain mode shares due to restrictions in the shift of modes (see parametrization of parameters alphaf and betaf). Especially also when constraints for minimum/maximum mode shares are active.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_mode_shiftMethod
constraint_mode_shift(model::JuMP.Model, data_structures::Dict)

Constraints for the rate of the mode shfit.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_monetary_budgetMethod
constraint_vehicle_purchase(model::JuMP.Model, data_structures::Dict)

Creates constraints for monetary budget for vehicle purchase by route.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_vehicle_agingMethod
constraint_vehicle_aging(model::JuMP.Model, data_structures::Dict)

Creates constraints for vehicle aging.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data

Returns

  • model::JuMP.Model: JuMP model with the constraints added
source
TransComp.constraint_vehicle_sizingMethod
constraint_vehicle_sizing(model::JuMP.Model, data_structures::Dict)

Creates constraint for vehicle sizing.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.constraint_vehicle_stock_shiftMethod
constraint_vehicle_stock_shift(model::JuMP.Model, data_structures::Dict)

Constraints for vehicle stock turnover.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.create_emission_price_along_pathMethod
create_emission_price_along_path(k::Path, y::Int64, data_structures::Dict)

Calculating the carbon price along a given route based on the regions that the path lies in. (currently simple calculation by averaging over all geometric items among the path).

Arguments

  • k::Path: path
  • data_structures::Dict: dictionary with the input data
source
TransComp.create_m_tv_pairsMethod
create_m_tv_pairs(techvehicle_list::Vector{TechVehicle}, mode_list::Vector{Mode})

Creates a set of pairs of mode and techvehicle IDs.

Arguments

  • techvehicle_list::Vector{TechVehicle}: list of techvehicles
  • mode_list::Vector{Mode}: list of modes

Returns

  • mtvpairs::Set: set of pairs of mode and techvehicle IDs
source
TransComp.create_modelMethod
create_model(model::JuMP.Model, data_structures::Dict)

Definition of JuMP.model and adding of variables.

Arguments

  • model::JuMP.Model: JuMP model
  • data_structures::Dict: dictionary with the input data and parsing of the input parameters

Returns

  • model::JuMP.Model: JuMP model with the variables added
  • data_structures::Dict: dictionary with the input data
source
TransComp.create_p_r_k_e_setMethod
create_p_r_k_e_set(odpairs::Vector{Odpair})

Creates a set of pairs of product, odpair, path, and element IDs.

Arguments

  • odpairs::Vector{Odpair}: list of odpairs

Returns

  • prkepairs::Set: set of pairs of product, odpair, path, and element IDs
source
TransComp.create_p_r_k_g_setMethod
create_p_r_k_g_set(odpairs::Vector{Odpair})

Creates a set of pairs of product, odpair, path, and element IDs.

Arguments

  • odpairs::Vector{Odpair}: list of odpairs

Returns

  • prkgpairs::Set: set of pairs of product, odpair, path, and element IDs
source
TransComp.create_p_r_k_n_setMethod
create_p_r_k_n_set(odpairs::Vector{Odpair})

Creates a set of pairs of product, odpair, path, and element IDs.

Arguments

  • odpairs::Vector{Odpair}: list of odpairs

Returns

  • prknpairs::Set: set of pairs of product, odpair, path, and element IDs
source
TransComp.create_p_r_k_setMethod
create_p_r_k_set(odpairs::Vector{Odpair})

Creates a set of pairs of product, odpair, and path IDs.

Arguments

  • odpairs::Vector{Odpair}: list of odpairs

Returns

  • prk_pairs::Set: set of pairs of product, odpair, and path IDs
source
TransComp.create_r_k_setMethod
create_r_k_set(odpairs::Vector{Odpair})

Creates a set of pairs of odpair and path IDs.

Arguments

  • odpairs::Vector{Odpair}: list of odpairs

Returns

  • rkpairs::Set: set of pairs of odpair and path IDs
source
TransComp.create_tv_id_setMethod
create_tv_id_set(techvehicle_list::Vector{TechVehicle}, mode_list::Vector{Mode})

Creates a list of techvehicle IDs.

Arguments

  • techvehicle_list::Vector{TechVehicle}: list of techvehicles
  • mode_list::Vector{Mode}: list of modes

Returns

  • techvehicleids2::Set: set of techvehicle IDs
source
TransComp.create_v_t_setMethod
create_v_t_set(techvehicle_list::Vector{TechVehicle})

Creates a set of pairs of techvehicle IDs.

Arguments

  • techvehicle_list::Vector{TechVehicle}: list of techvehicles

Returns

  • tvpairs::Set: set of pairs of techvehicle IDs
source
TransComp.generate_exact_length_subsetsMethod
generate_exact_length_subsets(start_year::Int, end_year::Int, delta_y::Int)

Generates a list of subsets of years with a fixed length.

Arguments

  • start_year::Int: The first year.
  • end_year::Int: The last year.
  • delta_y::Int: The length of the subsets.
source
TransComp.get_input_dataMethod
get_input_data(path_to_source_file::String)

This function reads the input data and checks requirements for the content of the file.

Arguments

  • pathtosource_file::String: path to the source file

Returns

  • data_dict::Dict: dictionary with the input data
source
TransComp.objectiveMethod
objective(model::Model, data_structures::Dict)

Definition of the objective function for the optimization model.

Arguments

  • model::Model: JuMP model
  • data_structures::Dict: dictionary with the input data
source
TransComp.parse_dataMethod
parse_data(data_dict::Dict)

Parses the input data into the corresponding parameters in struct format from structs.jl.

Arguments

  • data_dict::Dict: dictionary with the input data

Returns

  • data_structures::Dict: dictionary with the parsed data
source
TransComp.save_resultsFunction
save_results(model::Model, case_name::String)

Saves the results of the optimization model to YAML files.

Arguments

  • model::Model: JuMP model
  • case_name::String: name of the case
  • fileforresults::String: name of the file to save the results
  • data_structures::Dict: dictionary with the input data
source