FactoryLogic module

class FactoryLogic.FactoryLogic(width, height, conveyor, inserter, assembler)[source]

Bases: object

This class conatins the logic that prevents any collisions between all factory elements.

Parameters:
  • width (Int) – Width of the blueprint

  • height (Int) – Height of the blueprint

  • conveyor (Array[Array] EnumSort) – Reference to the conveyor directions variable

  • inserter (Array[Array] EnumSort) – Reference to the inserter directions variable

  • assembler (Array[Array] BitVec) – Reference to the assembler collision_area variable

collision()[source]

Creates a constarint that ensures that all elements of the blueprint (conveyors, inserters and assemblers) don’t collide between each other

Returns:

the constraint that ensures there can’t be any elements in the same cell of the blueprint

Return type:

Array

constraints()[source]

Creates a list of all the constarints representing the logic of the class

Returns:

the constraint that ensures there can’t be any elements in the same cell of the blueprint

Return type:

Array