forked from StanfordASL/AMoD-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEAMoDproblemRT.m
45 lines (36 loc) · 2.67 KB
/
EAMoDproblemRT.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
classdef EAMoDproblemRT < AbstractEAMoDproblem
% EAMoDproblemRT Extends AbstractEAMoDproblem to implement the electric AMoD problem in the real-time formulation.
% The real-time formulation assumes that the passenger-carrying vehicles follow pre-computed routes and only optimizes the flows of the
% rebalancing vehicles. This leads to a substantial reduction in the size of the problem and, thus, faster solving times.
methods
function obj = EAMoDproblemRT(spec)
% EAMoDproblemRT Constructs an EAMoDproblemRT object to represent the electric AMoD problem in the real-time formulation
% obj = EAMoDproblemRT(spec) where spec is an instance of
% EAMoDspec specifying the problem.
%
% See also EAMoDspec
n_passenger_flow_in_optimization = 0;
obj@AbstractEAMoDproblem(spec,n_passenger_flow_in_optimization);
end
[lb_StateVector,ub_StateVector] = CreateStateVectorBounds(obj)
[Aeq_CustomerChargeConservation, Beq_CustomerChargeConservation] = CreateEqualityConstraintMatrices_CustomerChargeConservation(obj)
[ChargingVehicleHist,DischargingVehicleHist,PaxVehicleHist,RebVehicleHist,IdleVehicleHist,AllVehicleHist] = GetVehicleStateHistograms(obj,varargin)
end
properties (SetAccess = private, GetAccess = public)
route_travel_time_matrix(:,:) double {mustBeNonnegative,mustBeReal,mustBeInteger} % route_travel_time_matrix(i,j) is the number of time-steps needed to go from i to j
route_charge_to_traverse_matrix(:,:) double {mustBeNonnegative,mustBeReal,mustBeInteger} % route_charge_to_traverse_matrix(i,j) is the number of charge units needed to go from i to j
route_travel_distance_matrix_m(:,:) double {mustBeNonnegative,mustBeReal} % route_travel_distance_matrix_m(i,j) is the distance in meters to go from i to j
route_path_cell(:,:) cell % route_path_cell{i,j} is the route from i to j expressed as a vector of connected nodes that need to be traversed
end
methods (Access = private)
[route_travel_time_matrix,route_charge_to_traverse_matrix,route_travel_distance_matrix_m,route_path_cell] = BuildRoutes(obj)
pax_cost_rt = ComputePaxCostRealTimeFormulation(obj)
pre_routed_trip_histogram = GetPreRoutedTripHistogram(obj)
end
methods (Access = protected)
[amod_cost_usd, pax_cost_usd,reb_cost_usd, relax_cost_usd] = ComputeAMoDcost(obj,varargin)
% Abstract methods in AbstractEAMoDproblem
road_residual_capacity_matrix = ComputeResidualRoadCapacity(obj)
constraint_array = GetConstraintArray(obj)
end
end