@mark1russell7/stack-endurance 0.8.25 → 0.8.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -187,6 +187,7 @@ if (storm !== undefined) {
187
187
 
188
188
  - The function finds the best share of the stores and of the runs of the converters. It does not use the take order.
189
189
  - It solves a linear program with exact rationals (`@mark1russell7/linear`). Only the change back to a number rounds.
190
+ - Each later objective starts from the optimal basis of the objective before it (the warm start of `@mark1russell7/linear`). Thus it does no phase 1.
190
191
  - The variables are the days, the take of each direct use, the runs of each converter, and the share of each stock for each draw.
191
192
  - Each draw of the set gets `d` times its demand. The takes of a resource are not more than its stock plus the gifts of its makers.
192
193
  - The runs of a converter with a limit `perDay` are not more than `perDay` times `devices` times `d`. The converters of one device share the limit.
package/build/add-on.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as checkEndurance, t as joinEndurance } from "./join-CxA4Td_Z.js";
1
+ import { r as checkEndurance, t as joinEndurance } from "./join-BwTee3Ue.js";
2
2
  import { t as ENDURANCE_SCHEMA } from "./layer-a3Fr70Uh.js";
3
3
  import { parseEndurance } from "./schema.js";
4
4
  // src/add-on.ts
package/build/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as ENDURANCE_SCHEMA } from "./layer-a3Fr70Uh.js";
2
- import { A as deviceUse, C as fixStops, D as storeCapacities, E as seasonPlan, F as addTo, I as dense, L as exact, M as fewestRow, N as reachOf, O as Program, P as valueAt, R as deviceKey, S as firstStop, T as seasonJoint, _ as seasonSupply, a as hasEnduranceError, b as storeAmounts, c as caseStopped, d as giftNeed, f as giftResource, g as monthlyShares, h as monthOf, i as curveFault, j as drawBlock, k as caseParts, l as drawDemand, m as monthEdges, n as ENDURANCE_CODES, o as SEASON_HORIZON_DAYS, p as hasSeason, r as checkEndurance, s as caseDraws, t as joinEndurance, u as enduranceOf, v as shareOf, w as seasonBest, x as fewestOpen, y as sowDays, z as isSource } from "./join-CxA4Td_Z.js";
2
+ import { A as deviceUse, C as fixStops, D as storeCapacities, E as seasonPlan, F as addTo, I as dense, L as exact, M as fewestRow, N as reachOf, O as Program, P as valueAt, R as deviceKey, S as firstStop, T as seasonJoint, _ as seasonSupply, a as hasEnduranceError, b as storeAmounts, c as caseStopped, d as giftNeed, f as giftResource, g as monthlyShares, h as monthOf, i as curveFault, j as drawBlock, k as caseParts, l as drawDemand, m as monthEdges, n as ENDURANCE_CODES, o as SEASON_HORIZON_DAYS, p as hasSeason, r as checkEndurance, s as caseDraws, t as joinEndurance, u as enduranceOf, v as shareOf, w as seasonBest, x as fewestOpen, y as sowDays, z as isSource } from "./join-BwTee3Ue.js";
3
3
  import { DEFAULT_MAX_SETS, STACK_SCHEMA, dateOfDay, dayNumber, neededParts, stopSets, survivalAt, weakestBound } from "@mark1russell7/system-stack";
4
4
  import { ONE, ZERO, add, div, equals, mul, neg, sign, sub, toNumber } from "@mark1russell7/rational";
5
5
  import { solveLexicographic } from "@mark1russell7/linear";
@@ -113,7 +113,7 @@ function jointDays(layer, caseCuts, options, needs) {
113
113
  coefficients: dense(fewestRow(runCols), program.count)
114
114
  }
115
115
  ];
116
- const solved = solveLexicographic(program.constraints(), objectives);
116
+ const solved = solveLexicographic(program.constraints(), objectives, { warm: true });
117
117
  if (solved.status !== "optimal") return endless;
118
118
  const x = solved.x;
119
119
  const takes = {};
@@ -261,7 +261,7 @@ function bestEndurance(layer, caseCuts, options) {
261
261
  sense: "min",
262
262
  coefficients: dense(fewestRow(last.blocks.flatMap((block) => [...block.runs])), last.program.count)
263
263
  }];
264
- const solved = solveLexicographic(last.program.constraints(), objectives);
264
+ const solved = solveLexicographic(last.program.constraints(), objectives, { warm: true });
265
265
  if (solved.status !== "optimal") throw new Error("The last program of the best endurance has no optimum. The point of the last step is a point of it.");
266
266
  const withStore = new Set(layer.stores.map((store) => store.resource));
267
267
  for (const block of last.blocks) {