Skip to content

Gave Pump Scheduling problems more accuracy at the cost of more computation time#350

Merged
wrigjl merged 2 commits into
CSharpAPIfrom
update/pumpschedulingUpdate
Jul 4, 2026
Merged

Gave Pump Scheduling problems more accuracy at the cost of more computation time#350
wrigjl merged 2 commits into
CSharpAPIfrom
update/pumpschedulingUpdate

Conversation

@Trosper3

@Trosper3 Trosper3 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Before:

const int Buckets = 1000 — always 1000 buckets regardless of tank size
bucketSize = cap / 1000 — each bucket represented a fraction of capacity

After:

buckets = (int)Math.Ceiling(cap) — number of buckets equals the tank capacity (in gallons)
bucketSize = 1.0 — each bucket represents exactly 1 gallon

The effect is that tank levels are now tracked at 1-gallon precision instead of cap/1000 precision. For the default 10,000-gallon tank this makes buckets 10× finer (10,000 vs 1,000), but the real benefit is correctness — the bucket count now scales with the actual tank size rather than being an arbitrary constant. The change appears in both the CM and EM solvers, and in two separate DP methods within the EM solver.

@wrigjl wrigjl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the comment above on infinity handling.

Comment thread Problems/NPHard/NPH_PUMPSCHEDULINGEM/Solvers/PumpSchedulingEMSolver.cs Outdated
@wrigjl wrigjl merged commit bb554cf into CSharpAPI Jul 4, 2026
5 checks passed
@wrigjl wrigjl deleted the update/pumpschedulingUpdate branch July 4, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants