Question regarding Path Energy Costs

15 views
Skip to first unread message

Nano Byte

unread,
Feb 23, 2026, 2:56:19 AM (12 days ago) Feb 23
to or-tools-discuss
Hello,

I stumbled upon the method
SetPathEnergyCostOfVehicle()
which says
"Cost(i) = Cumul_Force(j) * Transit_Distance(i, j)"

However, digging into the implementation I found in graph_constraints.cc the line actually impelemting (?) the cost like this:

const int64_t distance_min = specification_.distances[current]->Min();
const int64_t distance_max = specification_.distances[current]->Max();
...
Where I do not See the transit var, but the Min and Max Cumul distance (aka Transit + Slack).

So my Question to all with deep understanding of this Method:
Is
"Cost(i) = Cumul_Force(j) * Transit_Distance(i, j)"
OR
"Cost(i) = Cumul_Force(j) * (Transit_Distance(i, j) + Slack_Distance(i, j)"
?

Thanks and kind Regards
N.


Reply all
Reply to author
Forward
0 new messages