Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capacity simulation #151

Merged
merged 7 commits into from
Sep 11, 2024
Merged

Capacity simulation #151

merged 7 commits into from
Sep 11, 2024

Conversation

nilspenzel
Copy link
Contributor

No description provided.

	Given the list of all events of a vehicle, the capacity simulation
	yields all ranges of indexes in which a pair of new pickup
	and dropoff can	be inserted without violating any of the
	capacity constraints
import { capacitySimulation } from './routes/api/whitelist/capacitySimulation';

function createEventCapacitiesOnly(capacities: Capacities, is_pickup: boolean): Event {
const now = new Date(Date.now());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const now = new Date(Date.now());
const now = new Date();

Comment on lines 11 to 14
passengers: capacities.passengers,
bikes: capacities.bikes,
wheelchairs: capacities.wheelchairs,
luggage: capacities.luggage,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
passengers: capacities.passengers,
bikes: capacities.bikes,
wheelchairs: capacities.wheelchairs,
luggage: capacities.luggage,
capacities,

passengers: requiredNewEvent.passengers
};
const possibleInsertions: Range[] = [];
let start: number | undefined = isValid(capacities, current) ? -1 : undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let start: number | undefined = isValid(capacities, current) ? -1 : undefined;
let start: number | undefined = isValid(capacities, current) ? 0 : undefined;

@felixguendling felixguendling merged commit cc41fc7 into master Sep 11, 2024
2 checks passed
@felixguendling felixguendling deleted the capacity-simulation branch September 11, 2024 16:34
felixguendling added a commit that referenced this pull request Sep 11, 2024
* Add capacity simulation

	Given the list of all events of a vehicle, the capacity simulation
	yields all ranges of indexes in which a pair of new pickup
	and dropoff can	be inserted without violating any of the
	capacity constraints

* Add tests for capacity simulation

* Format

* Format

* Refactor

* fix company test

* playwright config: remove while true loop for dev config

---------

Co-authored-by: Felix Gündling <[email protected]>
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