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
The total balance of the factory
- rtype
array
- rtype
float
- rtype
Dict
[int
,int
]
Initial balance of the factory
Initial Wallet
- rtype
Dict
[Tuple
[int
,int
],Job
]
- rtype
array
- rtype
float
Maximum storage allowed in this factory
Minimum allowed balance
Minimum allowed storage per product
- rtype
int
- rtype
int
- rtype
Dict
[int
,int
]
total balance including hidden money
- rtype
int
- 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
andline
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
- Return type
float
- Return type
Dict
[int
,int
]
-
initial_balance
= 0.0¶ Initial balance of the factory
-
initial_wallet
= 0.0¶ Initial Wallet
-
line_schedules
¶ - Return type
array
-
loans
¶ - Return type
float
-
max_storage
= 9223372036854775807¶ Maximum storage allowed in this factory
-
min_balance
= 0¶ Minimum allowed balance
-
min_storage
= 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
-
schedule
(job, override=False)[source]¶ Schedules the given job at its
time
andline
optionally overriding whatever was already scheduled :type job:Job
:param job: :param override:- Return type
None
- Returns
Success/failure
-
step
()[source]¶ - Return type
List
[ProductionReport
]