sampo.generator.environment.contractor_by_wg#

Overview#

Classes#

ContractorGenerationMethod

Generic enumeration.

Function#

_value_by_req(method, req)

Sets the function by which the number for the function of searching for a contractor by the graph of works

get_contractor_by_wg(wg, scaler, method)

Creates a pool of contractor resources based on job requirements, selecting the maximum specified parameter

Classes#

class sampo.generator.environment.contractor_by_wg.ContractorGenerationMethod#

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

MIN = 'min'#
MAX = 'max'#
AVG = 'avg'#

Functions#

sampo.generator.environment.contractor_by_wg._value_by_req(method: ContractorGenerationMethod, req: sampo.schemas.requirements.WorkerReq) int#

Sets the function by which the number for the function of searching for a contractor by the graph of works is determined by the given parameter

Parameters:
  • method – type the specified parameter: min ~ min_count, max ~ max_count, avg ~ (min_count + max_count) / 2

  • req – the Worker Req

Returns:

sampo.generator.environment.contractor_by_wg.get_contractor_by_wg(wg: sampo.schemas.graph.WorkGraph, scaler: float | None = 1, method: ContractorGenerationMethod = ContractorGenerationMethod.AVG) sampo.schemas.contractor.Contractor#

Creates a pool of contractor resources based on job requirements, selecting the maximum specified parameter

Parameters:
  • wg – The graph of works for which it is necessary to find a set of resources

  • scaler – Multiplier for the number of resources in the contractor

  • method – type the specified parameter: min ~ min_count, max ~ max_count, avg ~ (min_count + max_count) / 2

Returns:

Contractor capable of completing the work schedule