From 2e7fd842a695c6db1ab1b2299ee53c778a1a90c9 Mon Sep 17 00:00:00 2001 From: David Masad Date: Sat, 6 Jul 2019 10:55:43 -0400 Subject: [PATCH] Fix bug in TextGrid Make sure TextGrid is instantiated with the converter. --- mesa/visualization/TextVisualization.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mesa/visualization/TextVisualization.py b/mesa/visualization/TextVisualization.py index a7d658843aa..ad7b1695f6b 100644 --- a/mesa/visualization/TextVisualization.py +++ b/mesa/visualization/TextVisualization.py @@ -106,14 +106,11 @@ def __init__(self, grid, converter): Args: grid: The underlying Grid object. converter: function for converting the content of each cell - to ascii + to ascii. Takes the contents of a cell, and returns + a single character. """ self.grid = grid - - @staticmethod - def converter(x): - """ Text content of cells. """ - return 'X' + self.converter = converter def render(self): """ What to show when printed. """