Type and functions
TransComp.EmissionLimitbymode
— TypeEmissionLimitbymode
An 'EmissionLimitbymode' describes emissions constrained for a mode.
Fields
id::Int
: unique identifier of the emission constraintmode::Mode
: mode of transportemission::Float64
: emission constraint of the vehicle type (tCO2/year)year::Int
: year of the expected emission constraint
TransComp.EmissionLimitbyyear
— TypeEmissionLimitbyyear
An 'EmissionLimitbyyear' describes an emission goal for a specific year for the total emissions.
Fields
id::Int
: unique identifier of the emission constraintemission::Float64
: emission constraintyear::Int
: year of the expected emission constraint
TransComp.FinancialStatus
— TypeFinancialStatus
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 statusname::String
: name of the financial statusVoT
: value of time in €/hmonetary_budget_purchase
: budget for purchasing costs in €/yearmonetary_budget_purchase_lb
: lower bound of the budget for purchasing costs in €/yearmonetary_budget_purchase_ub
: upper bound of the budget for purchasing costs in €/yearmonetary_budget_purchase_time_horizon
: time horizon of the budget for purchasing costs in years, indicating the time period over which the budget is valid
TransComp.Fuel
— TypeFuel
A 'Fuel' represents the energy source used for the vehicle propulsion.
Fields
id::Int
: unique identifier of the fuelname::String
: name of the fuelemission_factor::Float64
: emission factor of the fuel in gCO2/kWhcost_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
TransComp.GeographicElement
— TypeGeographicElement
A 'Graph_item' represents a graph item that is either a node or an edge.
Fields
id::Int
: unique identifier of the graph itemtype::String
: type of the graph item (either 'node' or 'edge')name::String
: name of the graph itemcarbon_price::Array{Float64,1}
: carbon price in €/tCO2 for each yearfrom::Node
: the node from which the edge startsto::Node
: the node to which the edge endslength::Float64
: length of the connection in km
TransComp.InitDetourTime
— TypeInitDetourTimes
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 timesfuel::Fuel
: fuel type of the fueling stationlocation::GeographicElement
: location of the fueling stationdetour_time::Float64
: detour time in h
TransComp.InitialFuelingInfr
— TypeInitialFuelingInfr
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 infrastructuretechnology::Technology
: technology of the fueling infrastructureallocation
: allocation of the fueling infrastructureinstalled_kW::Float64
: installed capacity of the fueling infrastructure in kW
TransComp.InitialModeInfr
— TypeInitialModeInfr
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 infrastructuremode::Mode
: mode of transportallocation
: allocation of the mode infrastructureinstalled_ukm::Float64
: installed transport capacity of the mode infrastructure in Ukm
TransComp.InitialSupplyInfr
— TypeInitialSupplyInfr
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 infrastructurefuel::Fuel
: fuel type of the supply infrastructureallocation
: allocation of the supply infrastructureinstalled_kW::Float64
: installed capacity of the supply infrastructure in kW
TransComp.InitialVehicleStock
— TypeInitialVehicleStock
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 stocktechvehicle::TechVehicle
: vehicle type and technology of the vehicleyear_of_purchase::Int
: year in which the vehicle was purchasedstock::Float64
: number of vehicles of this type in the initial vehicle stock
TransComp.Mode
— TypeMode
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 modename::String
: name of the modequantify_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
TransComp.ModeSharemaxbyyear
— TypeModeSharemaxbyyear
Maximum mode shares of a transport mode in a specific year.
Fields
id::Int
: unique identifier of the mode sharemode::Mode
: mode of transportshare::Float64
: maximum share of the modeyear::Int
: year of the maximum mode shareregion_type::Array{Regiontype,1}
: array of region types that are affected by this TechVehicle share constraint
TransComp.ModeShareminbyyear
— TypeModeShareminbyyear
Minimum mode shares of a transport mode in a specific year.
Fields
id::Int
: unique identifier of the mode sharemode::Mode
: mode of transportshare::Float64
: minimum share of the modeyear::Int
: year of the minimum mode shareregion_type::Array{Regiontype,1}
: array of region types that are affected by this TechVehicle share constraint
TransComp.Odpair
— TypeOdpair
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 odpairorigin::Node
: origin of the transport demanddestination::Node
: destination of the transport demandpaths::Array{Path, 1}
: possible paths between origin and destinationF
: number of trips in p/year or t/yearproduct::Product
: product that is transportedvehicle_stock_init::Array{InitialVehicleStock,1}
: initial vehicle stockfinancial_status::FinancialStatus
: financial status of the transport demandregion_type::Regiontype
: region type of the transport demandtravel_time_budget::Float64
: travel time budget in h/year
TransComp.Path
— TypePath
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 pathname::String
: name of the pathlength::Float64
: length of the path in kmsequence
: sequence of nodes and edges that are passed through
TransComp.Product
— TypeProduct
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 productname::String
: name of the product
TransComp.Regiontype
— TypeRegiontype
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 regiontypename::String
: name of the regiontypespeed::Float64
: average speed in km/hcosts_var::Array{Float64, 1}
: variable costs in €/vehicle-kmcosts_fix::Array{Float64, 1}
: fixed costs in €/year
TransComp.SupplyType
— TypeSupplyType
A 'SupplyType' represents the type of supply infrastructure that is used for fueling vehicles.
Fields
id::Int
: unique identifier of the supply typename::String
: name of the supply typefuel::Fuel
: fuel type of the supply infrastructureinstall_costs::Array{Float64}
: installation costs in €om_costs::Array{Float64}
: operation and maintenance costs in €/year
TransComp.TechVehicle
— TypeTechVehicle
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 vehiclename::String
: name of the vehiclevehicle_type::Vehicletype
: type of the vehicletechnology::Technology
: technology used in the vehiclecapital_cost::Array{Float64}
: capital cost in €maintenance_cost_annual::Array{Array{Float64,1},1}
: annual maintenance cost in €/yearmaintenance_cost_distance::Array{Array{Float64,1},1}
: maintenance cost per km in €/kmW::Array{Float64}
: load capacity in tspec_cons::Array{Float64}
: specific consumption in kWh/kmLifetime::Array{Int}
: lifetime of the vehicle in yearsAnnualRange::Array{Float64}
: annual range in kmproducts::Array{Product}
: number of vehicles of this typetank_capacity::Array{Float64}
: battery capacity in kWhpeak_fueling::Array{Float64}
: peak charging power in kWfueling_time´::Array{Float64}
: refueling time in h (total tank) - array with values by generation
TransComp.Technology
— TypeTechnology
A 'Technology' represents the drivetrain technology used in the vehicle.
Fields
id::Int
: unique identifier of the technologyname::String
: name of the technologyfuel::Fuel
: fuel used by the technology
TransComp.VehicleSubsidy
— TypeVehicleSubsidy
A 'VehicleSubsidy' describes the subsidy for a vehicle type in a specific year.
Fields
id::Int
: unique identifier of the subsidyname::String
: name of the subsidyyears::Array{Int,1}
: years in which the subsidy is validtechvehicle::TechVehicle
: vehicle type and technologysubsidy::Float64
: subsidy in €
TransComp.Vehicletype
— TypeVehicletype
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 typename::String
: name of the vehicle typemode::Mode
: mode of transport that the vehicle type is used forproduct::Product
: product that the vehicle type is used for
TransComp.base_define_variables
— Methodbase_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
TransComp.check_correct_format_Fuel
— Methodcheck_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.
TransComp.check_correct_format_InitialModeInfr
— Methodcheck_correct_format_InitialModeInfr(data_structures::Dict)
Check if the format of the InitialModeInfr entries is correct.
Arguments
data_structures::Dict
: The input data.
TransComp.check_correct_format_Mode
— Methodcheck_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.
TransComp.check_correct_format_Odpair
— Methodcheck_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.
TransComp.check_correct_format_Path
— Methodcheck_correct_format_Path(data_structures::Dict)
Check if the format of the Path entries is correct.
Arguments
data_structures::Dict
: The input data.
TransComp.check_correct_format_Product
— Methodcheck_correct_format_Product(data_structures::Dict, years)
Check if the format of the Product entries is correct.
Arguments
data_structures::Dict
: The input data.
TransComp.check_correct_format_Speed
— Methodcheck_correct_format_Speed(data_structures::Dict)
Check if the format of the Speed entries is correct.
Arguments
data_structures::Dict
: The input data.
TransComp.check_correct_format_Technology
— Methodcheck_correct_format_Technology(data_structures::Dict, years)
Check if the format of the Technology entries is correct.
Arguments
data_structures::Dict
: The input data.
TransComp.check_correct_formats_FinancialStatus
— Methodcheck_correct_formats_FinancialStatus(data_structures::Dict, years)
Check if the format of the FinancialStatus entries is correct.
Arguments
data_structures::Dict
: The input data.
TransComp.check_correct_formats_GeographicElement
— Methodcheck_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.
TransComp.check_folder_writable
— Methodcheck_folder_writable(folder_path::String)
Check if the folder exists and can be written in.
Arguments
folder_path::String
: The path to the folder.
TransComp.check_input_file
— Methodcheck_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.
TransComp.check_model_parametrization
— Methodcheck_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.
TransComp.check_required_keys
— Methodcheck_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.
TransComp.check_required_sub_keys
— Methodcheck_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.
TransComp.check_uniquness_of_ids
— Methodcheck_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.
TransComp.constraint_demand_coverage
— Methodconstraint_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
TransComp.constraint_emissions_by_mode
— Methodconstraint_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
TransComp.constraint_fueling_demand
— Methodconstraint_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
TransComp.constraint_fueling_infrastructure
— Methodconstraint_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
TransComp.constraint_market_share
— Methodconstraint_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
TransComp.constraint_max_mode_share
— Methodconstraint_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
TransComp.constraint_min_mode_share
— Methodconstraint_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
TransComp.constraint_mode_infrastructure
— Methodconstraintmodeinfrastructure(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
TransComp.constraint_mode_share
— Methodconstraint_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
TransComp.constraint_mode_shift
— Methodconstraint_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
TransComp.constraint_monetary_budget
— Methodconstraint_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
TransComp.constraint_vehicle_aging
— Methodconstraint_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
TransComp.constraint_vehicle_sizing
— Methodconstraint_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
TransComp.constraint_vehicle_stock_shift
— Methodconstraint_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
TransComp.create_emission_price_along_path
— Methodcreate_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
TransComp.create_m_tv_pairs
— Methodcreate_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
TransComp.create_model
— Methodcreate_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
TransComp.create_p_r_k_e_set
— Methodcreate_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
TransComp.create_p_r_k_g_set
— Methodcreate_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
TransComp.create_p_r_k_n_set
— Methodcreate_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
TransComp.create_p_r_k_set
— Methodcreate_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
TransComp.create_r_k_set
— Methodcreate_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
TransComp.create_tv_id_set
— Methodcreate_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
TransComp.create_v_t_set
— Methodcreate_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
TransComp.generate_exact_length_subsets
— Methodgenerate_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.
TransComp.get_input_data
— Methodget_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
TransComp.objective
— Methodobjective(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
TransComp.parse_data
— Methodparse_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
TransComp.save_results
— Functionsave_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