lace.Engine.flatten_columns
- Engine.flatten_columns()
Flatten the column assignment.
The resulting states will all have one view.
Examples
>>> from lace.examples import Satellites >>> engine = Satellites() >>> engine.column_assignment(0) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0] >>> engine.column_assignment(1) [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] >>> engine.flatten_columns() >>> engine.column_assignment(0) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >>> engine.column_assignment(1) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >>> all(sum(engine.column_assignment(i)) == 0 for i in range(engine.n_states)) True