Scheduler¶
- class scml.scml2019.Scheduler(manager_id, awi, max_insurance_premium=inf, horizon=None)[source]¶
Bases:
abc.ABC
Base class for all schedulers
Methods Summary
bookmark
()Sets a bookmark to the current location
delete_bookmark
(bookmark_id)Commits everything since the bookmark so it cannot be rolled back
find_schedule
(contracts, start, end[, ...])Schedules a set of contracts and returns either the search_for_schedule or None if infeasible
init
(simulator, products, processes, ...)Called by the FactoryManager after it is initialized
rollback
(bookmark_id)Rolls back to the given bookmark ID
schedule
([contracts, ...])Schedules a set of contracts and returns either the search_for_schedule or None if infeasible
Methods Documentation
- delete_bookmark(bookmark_id)[source]¶
Commits everything since the bookmark so it cannot be rolled back
- Parameters
bookmark (bookmark_id The bookmark ID returned from) –
Remarks:
You can only rollback in the reverse order of bookmarks. If the bookmark ID given here is not the one at the top of the bookmarks stack, the deletion will fail (return False)
- Return type
- abstract find_schedule(contracts, start, end, assume_no_further_negotiations=False, ensure_storage_for=0, start_at=0)[source]¶
Schedules a set of contracts and returns either the search_for_schedule or None if infeasible
- Parameters
start (
int
) –end (
int
) –contracts (
Collection
[Contract
]) –assume_no_further_negotiations –
ensure_storage_for (
int
) –start_at (
int
) – The time at which to start scheduling. No jobs will be scheduled before this time.
- Return type
- Returns
Schedule information (See
ScheduleInfo
for its contents).
- init(simulator, products, processes, profiles, producing)[source]¶
Called by the FactoryManager after it is initialized
- rollback(bookmark_id)[source]¶
Rolls back to the given bookmark ID
- Parameters
bookmark (bookmark_id The bookmark ID returned from) –
Remarks:
You can only rollback in the reverse order of bookmarks. If the bookmark ID given here is not the one at the top of the bookmarks stack, the rollback will fail (return False)
- Return type
- schedule(contracts=(), assume_no_further_negotiations=False, ensure_storage_for=0, start_at=0)[source]¶
Schedules a set of contracts and returns either the search_for_schedule or None if infeasible
- Parameters
given (whatever it has scheduled before. If the state is) –
scheduling (it is taken as the initial state for) –
contracts (
Collection
[Contract
]) – The contracts to be scheduledassume_no_further_negotiations – whether to assume that more negotiations can take place (to secure
needs) (production) –
ensure_storage_for (
int
) – A minimum time to ensure that products are available in storage before contract deliverytimes (sell contracts) –
start_at (
int
) – The time at which to start scheduling. No jobs will be scheduled before this time.
- Return type
- Returns
ScheduleInfo
describing the schedulo and any production needs and updates to be carried out.