logistic_condition
- class LogisticConditionMixin
(Implicitly inherits
ControlBehaviorMixin
)Allows the Entity to have an logistic enable condition, such as when the amount of some item in the logistic network exceeds some constant.
- remove_logistic_condition() None
Removes the logistic condition of the Entity. Does nothing if the Entity has no logistic condition to remove.
- set_logistic_condition(a: str | None = None, cmp: str = '<', b: str | int = 0) None
Sets the logistic condition of the Entity.
cmp
can be specified as stored as the single unicode character which is used by Factorio, or you can use the Python formatted 2-character equivalents:# One of: [">", "<", "=", "≥", "≤", "≠"] # Or, alternatively: [">", "<", "==", ">=", "<=", "!="]
If specified in the second format, they are converted to and stored as the first format.
- Parameters:
a – The string name of the first signal.
cmp – The operation to use, as specified above.
b – The string name of the second signal, or some 32-bit constant.
- Raises:
DataFormatError – If
a
is not a valid signal name, ifcmp
is not a valid operation, or ifb
is neither a valid signal name nor a constant.
- property connect_to_logistic_network: str
Whether or not this entity should use it’s logistic network condition to control its operation (if it has one).
- Getter:
Gets the value of
connect_to_logistic_network
, orNone
if not set.- Setter:
Sets the value of
connect_to_logistic_network
. Removes the key if set toNone
.- Type:
bool
- Raises:
TypeError – If set to anything other than a
bool
orNone
.