sampo.schemas.resources#

Overview#

Classes#

WorkerProductivityMode

Generic enumeration.

Resource

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

Worker

A class dedicated to human resources

ConstructionObject

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

EmptySpaceConstructionObject

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

Equipment

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

Material

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

Classes#

class sampo.schemas.resources.WorkerProductivityMode#

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

Static = ('static',)#
Stochastic = 'stochastic'#
class sampo.schemas.resources.Resource(id: str, name: str, count: int, contractor_id: str | None = '')#

Bases: sampo.schemas.serializable.AutoJSONSerializable[Equipment], sampo.schemas.identifiable.Identifiable

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

property count#
id: str#
name: str#
count: int#
contractor_id: str | None = ''#
get_agent_id() sampo.schemas.types.AgentId#
class sampo.schemas.resources.Worker(id: str, name: str, count: int, contractor_id: str | None = '', productivity: sampo.schemas.interval.IntervalGaussian | None = IntervalGaussian(1, 0, 1, 1), cost_one_unit: float | None = None)#

Bases: Resource

A class dedicated to human resources

Parameters:
  • count – the number of people in this resource

  • contractor_id – Contractor id if resources are added directly to the contractor

  • productivity – interval from Gaussian or Uniform distribution, that contains possible values of

productivity of certain worker

ignored_fields = ['productivity']#
copy()#

Return copied current object

Returns:

object of Worker class

with_count(count: int) Worker#

Update count field

Parameters:

count – amount of current type of worker

Returns:

upgraded current object

get_cost() float#

Returns cost of this worker entry

get_agent_id() sampo.schemas.types.AgentId#

Return the agent unique identifier in schedule

Returns:

contractor’s id and name

get_productivity(rand: random.Random, productivity_mode: WorkerProductivityMode) float#

Return the productivity of the worker team. It has 2 mods: stochastic and non-stochastic.

Parameters:
  • productivity_mode

  • rand – parameter for stochastic part

__repr__()#

Return repr(self).

__str__()#

Return str(self).

class sampo.schemas.resources.ConstructionObject(id: str, name: str, count: int, contractor_id: str | None = '')#

Bases: Resource

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

class sampo.schemas.resources.EmptySpaceConstructionObject(id: str, name: str, count: int, contractor_id: str | None = '')#

Bases: ConstructionObject

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

id: str = '00000000000000000'#
name: str = 'empty space construction object'#
class sampo.schemas.resources.Equipment(id: str, name: str, count: int, contractor_id: str | None = '')#

Bases: Resource

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

class sampo.schemas.resources.Material(id: str, name: str, count: int, cost_one_unit: float | None = 1)#

Bases: Resource

A class summarizing the different resources used in the work: Human resources, equipment, materials, etc.

copy()#
with_count(count: int) Material#