GreedyScheduler

class scml.scml2019.GreedyScheduler(manager_id, awi, max_insurance_premium=inf, horizon=None, add_catalog_prices=True, strategy='latest', profile_sorter='total-cost>time')[source]

Bases: scml.scml2019.Scheduler

Default scheduler used by the DefaultFactoryManager

Methods Summary

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

input_cost(info)

input_unit_cost(info)

rtype

float

production_cost(info)

rtype

float

production_unit_cost(info)

rtype

float

schedule_contract(contract[, …])

Schedules this contract if possible and returns information about the resulting schedule

schedule_contracts(contracts[, end, …])

Schedules a set of contracts and returns the ScheduleInfo.

total_cost(info)

rtype

float

total_unit_cost(info)

rtype

float

unit_time(info)

rtype

float

Methods Documentation

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.

Returns

Schedule information (See ScheduleInfo for its contents).

init(simulator, products, processes, profiles, producing)[source]

Called by the FactoryManager after it is initialized

input_cost(info)[source]
input_unit_cost(info)[source]
Return type

float

production_cost(info)[source]
Return type

float

production_unit_cost(info)[source]
Return type

float

schedule_contract(contract, assume_no_further_negotiations=False, end=None, ensure_storage_for=0, start_at=0)[source]

Schedules this contract if possible and returns information about the resulting schedule

Parameters
  • contract (Contract) – The contract being scheduled

  • assume_no_further_negotiations – If true no further negotiations will be assumed possible

  • end (Optional[int]) – The scheduling horizon (None for the default).

  • ensure_storage_for (int) – The number of steps all needs must be in storage before they are consumed in production

  • start_at (int) – No jobs will be scheduled before that time.

Return type

ScheduleInfo

Returns

Full schedule information including validity, line schedulers, production needs, etc (see SchedulerInfo).

schedule_contracts(contracts, end=None, assume_no_further_negotiations=False, ensure_storage_for=0, start_at=0)[source]

Schedules a set of contracts and returns the ScheduleInfo.

Parameters
  • contracts (Collection[Contract]) – Contracts to schedule

  • assume_no_further_negotiations – If true, no further negotiations will be assumed to be possible

  • end (Optional[int]) – The end of the simulation for the schedule (exclusive)

  • ensure_storage_for (int) – Ensure that the outcome will be at the storage for at least this time

  • start_at (int) – The timestep at which to start scheduling

Return type

ScheduleInfo

Returns

ScheduleInfo giving the schedule after these contracts is included. valid member can be used to check whether this is a valid contract

total_cost(info)[source]
Return type

float

total_unit_cost(info)[source]
Return type

float

unit_time(info)[source]
Return type

float