![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solver.h>
Classes | |
struct | EnergyCost |
Public Attributes | |
std::vector< IntVar * > | nexts |
std::vector< IntVar * > | paths |
std::vector< IntVar * > | forces |
std::vector< IntVar * > | distances |
std::vector< EnergyCost > | path_energy_costs |
std::vector< bool > | path_used_when_empty |
std::vector< int64_t > | path_starts |
std::vector< int64_t > | path_ends |
std::vector< IntVar * > | costs |
A constraint that maintains the energy cost of paths. Energy is the integral of force applied over distance. More formally, the energy used on a path is: energy[path] = sum(node | paths[node] == path /\ node not end) forces[next[node]] * distances[node] where forces[n] is the force needed to move loads accumulated until, but excluding weight and distances[n] is the distance from n to its successor. For instance, if a path has a route with two pickup/delivery pairs where the first shipment weighs 1 unit, the second weighs 2 units, and the distance between nodes is one, the {force/distance} of nodes would be: start{0/1} P1{0/1} P2{1/1} D1{3/1} D2{2/1} end{0/0}. The energy would be 0*1 + 1*1 + 3*1 + 2*1 + 0*1. The cost per unit of energy is cost_per_unit_below_threshold until the force reaches the threshold, then it is cost_per_unit_above_threshold: min(threshold, force.CumulVar(Next(node))) * distance.TransitVar(node) * cost_per_unit_below_threshold + max(0, force.CumulVar(Next(node)) - threshold) * distance.TransitVar(node) * cost_per_unit_above_threshold.
Definition at line 1842 of file constraint_solver.h.
std::vector<IntVar*> operations_research::Solver::PathEnergyCostConstraintSpecification::costs |
Definition at line 1860 of file constraint_solver.h.
std::vector<IntVar*> operations_research::Solver::PathEnergyCostConstraintSpecification::distances |
Definition at line 1855 of file constraint_solver.h.
std::vector<IntVar*> operations_research::Solver::PathEnergyCostConstraintSpecification::forces |
Definition at line 1854 of file constraint_solver.h.
std::vector<IntVar*> operations_research::Solver::PathEnergyCostConstraintSpecification::nexts |
Definition at line 1852 of file constraint_solver.h.
std::vector<int64_t> operations_research::Solver::PathEnergyCostConstraintSpecification::path_ends |
Definition at line 1859 of file constraint_solver.h.
std::vector<EnergyCost> operations_research::Solver::PathEnergyCostConstraintSpecification::path_energy_costs |
Definition at line 1856 of file constraint_solver.h.
std::vector<int64_t> operations_research::Solver::PathEnergyCostConstraintSpecification::path_starts |
Definition at line 1858 of file constraint_solver.h.
std::vector<bool> operations_research::Solver::PathEnergyCostConstraintSpecification::path_used_when_empty |
Definition at line 1857 of file constraint_solver.h.
std::vector<IntVar*> operations_research::Solver::PathEnergyCostConstraintSpecification::paths |
Definition at line 1853 of file constraint_solver.h.