<s> """<STR_LIT>""" <EOL> from color_patch_model import ColorPatchModel <EOL> from mesa . visualization . modules import CanvasGrid <EOL> from mesa . visualization . ModularVisualization import ModularServer <EOL> _COLORS = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> GRID_ROWS = <NUM_LIT> <EOL> GRID_COLS = <NUM_LIT:50> <EOL> CELL_SIZE = <NUM_LIT:10> <EOL> CANVAS_HEIGHT = GRID_ROWS * CELL_SIZE <EOL> CANVAS_WIDTH = GRID_COLS * CELL_SIZE <EOL> def color_patch_draw ( cell ) : <EOL> '''<STR_LIT>''' <EOL> assert cell is not None <EOL> portrayal = { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:w>" : <NUM_LIT:1> , "<STR_LIT:h>" : <NUM_LIT:1> , "<STR_LIT>" : "<STR_LIT:true>" , "<STR_LIT>" : <NUM_LIT:0> } <EOL> portrayal [ "<STR_LIT:x>" ] = cell . get_col ( ) <EOL> portrayal [ "<STR_LIT:y>" ] = cell . get_row ( ) <EOL> portrayal [ "<STR_LIT>" ] = _COLORS [ cell . get_state ( ) ] <EOL> return portrayal <EOL> CANVAS_ELEMENT = CanvasGrid ( color_patch_draw , <EOL> GRID_COLS , GRID_ROWS , <EOL> CANVAS_HEIGHT , CANVAS_WIDTH ) <EOL> SERVER = ModularServer ( ColorPatchModel , <EOL> [ CANVAS_ELEMENT ] , "<STR_LIT>" , <EOL> GRID_ROWS , GRID_COLS ) <EOL> SERVER . launch ( ) </s>
