Add configurable no-prefer penalty to solver

This commit is contained in:
Ian Gulliver
2026-02-15 21:57:53 -08:00
parent 758d0708ec
commit af338114c6
4 changed files with 47 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ try {
document.getElementById('trip-name').textContent = trip.name;
document.getElementById('room-size').value = trip.room_size;
document.getElementById('pn-multiple').value = trip.prefer_not_multiple;
document.getElementById('np-cost').value = trip.no_prefer_cost;
document.getElementById('main').style.display = 'block';
document.getElementById('logout-btn').addEventListener('click', logout);
document.getElementById('room-size').addEventListener('change', async () => {
@@ -27,6 +28,10 @@ document.getElementById('pn-multiple').addEventListener('change', async () => {
const val = parseInt(document.getElementById('pn-multiple').value);
if (val >= 1) await api('PATCH', '/api/trips/' + tripID, { prefer_not_multiple: val });
});
document.getElementById('np-cost').addEventListener('change', async () => {
const val = parseInt(document.getElementById('np-cost').value);
if (val >= 0) await api('PATCH', '/api/trips/' + tripID, { no_prefer_cost: val });
});
let lastOveralls = {};