Repository navigation
Conversation
…loses #163) p_departure per battery gives the probability the device leaves during each step. p_a then weighs s[t] by it instead of valuing s[-1] alone, so a charge that may be cut short is worth less than one already in. Optional, absent it reproduces the previous model.
This was referenced Oct 4, 2026
Once the departure probabilities add up to one, the charge and discharge bounds of the later steps are zero. Without it the cost neutral tie break could put free surplus into a vehicle that is gone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #163
One optional field per battery lets the schedule weigh that a vehicle may leave before the horizon ends. Absent, the model is unchanged and every stored case solves as before.
r_departure: probability of leaving in each time step, the remainder stays.p_athen values the state of charge the device is expected to leave with, the departure weighted sum ofs[t], instead ofs[-1]. A charge that may be cut short is worth less than one already in. One objective term, no new variables or rows.p_E = 0andcharge_before_exportit did.p_demandpast a certain departure is a conflicting request. The demand penalty wins and the schedule fills the vehicle before it leaves, at real cost. The caller should cut the demand where it cuts the presence.tools/bench_departure.pyruns the stored cases against main, then with a 30 % departure chance spread over hours 6 to 12 on every battery without discharge. Plain: 5.20 s against 5.18 s total. Departure: 4.19 s, rows and columns unchanged, 020 and 028 solve faster with it. A certain departure at hour 12 over the 13 cases that reach it: 3.47 s before the bounds, 2.45 s with them, since the bounded steps leave the model in presolve. 023 drops from 0.69 to 0.04 s, 028 from 0.69 to 0.38 s.🤖 Generated with Claude Code