Skip to content

Commit

Permalink
Fix bug in TextGrid
Browse files Browse the repository at this point in the history
Make sure TextGrid is instantiated with the converter.
  • Loading branch information
dmasad committed Jul 6, 2019
1 parent 7ca4b4e commit 2e7fd84
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mesa/visualization/TextVisualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. """
Expand Down

0 comments on commit 2e7fd84

Please sign in to comment.