Factory

class scml.scml2019.Factory(initial_storage, initial_wallet=0.0, id=<factory>, profiles=<factory>, max_storage=9223372036854775807, min_storage=0, min_balance=0, _jobs=<factory>)[source]

Bases: object

Represents a factory within an SCML world. It is only accessed by the SCML2020World so it need not be made public.

Attributes Summary

balance

The total balance of the factory

commands

rtype

array

hidden_money

rtype

float

hidden_storage

rtype

Dict[int, int]

initial_balance

Initial balance of the factory

initial_wallet

Initial Wallet

jobs

rtype

Dict[Tuple[int, int], Job]

line_schedules

rtype

array

loans

rtype

float

max_storage

Maximum storage allowed in this factory

min_balance

Minimum allowed balance

min_storage

Minimum allowed storage per product

n_lines

rtype

int

next_step

rtype

int

storage

rtype

Dict[int, int]

total_balance

total balance including hidden money

total_storage

rtype

int

wallet

rtype

float

Methods Summary

add_loan(total)

rtype

None

attach_to_world(world)

buy(product, quantity, price)

rtype

None

hide_funds(amount)

rtype

None

hide_product(product, quantity)

rtype

None

pay(payment)

rtype

None

receive(payment)

rtype

None

schedule(job[, override])

Schedules the given job at its time and line optionally overriding whatever was already scheduled :type job: Job :param job: :param override:

sell(product, quantity, price)

rtype

None

step()

rtype

List[ProductionReport]

transport_from(product, quantity)

rtype

None

transport_to(product, quantity)

rtype

None

unhide_funds(amount)

rtype

None

unhide_product(product, quantity)

rtype

None

Attributes Documentation

balance

The total balance of the factory

Return type

float

commands
Return type

array

hidden_money
Return type

float

hidden_storage
Return type

Dict[int, int]

initial_balance: float = 0.0

Initial balance of the factory

initial_wallet: dataclasses.InitVar[float] = 0.0

Initial Wallet

jobs
Return type

Dict[Tuple[int, int], Job]

line_schedules
Return type

array

loans
Return type

float

max_storage: int = 9223372036854775807

Maximum storage allowed in this factory

min_balance: int = 0

Minimum allowed balance

min_storage: int = 0

Minimum allowed storage per product

n_lines
Return type

int

next_step
Return type

int

storage
Return type

Dict[int, int]

total_balance

total balance including hidden money

Return type

float

total_storage
Return type

int

wallet
Return type

float

Methods Documentation

add_loan(total)[source]
Return type

None

attach_to_world(world)[source]
buy(product, quantity, price)[source]
Return type

None

hide_funds(amount)[source]
Return type

None

hide_product(product, quantity)[source]
Return type

None

pay(payment)[source]
Return type

None

receive(payment)[source]
Return type

None

schedule(job, override=False)[source]

Schedules the given job at its time and line optionally overriding whatever was already scheduled :type job: Job :param job: :param override:

Return type

None

Returns

Success/failure

sell(product, quantity, price)[source]
Return type

None

step()[source]
Return type

List[ProductionReport]

transport_from(product, quantity)[source]
Return type

None

transport_to(product, quantity)[source]
Return type

None

unhide_funds(amount)[source]
Return type

None

unhide_product(product, quantity)[source]
Return type

None