# Path: labmaze/base.py
# class BaseMaze(metaclass=abc.ABCMeta):
#   def regenerate(self):
#   def entity_layer(self):
#   def variations_layer(self):
#   def height(self):
#   def width(self):
#   def max_variations(self):
#   def spawn_token(self):
#   def object_token(self):
# 
# Path: labmaze/defaults.py

# 
# Path: labmaze/text_grid.py
# class TextGrid(np.ndarray):
#   def __new__(cls, newline_delimited_string):
#   def __str__(self):


import itertools
import numpy as np
from labmaze import base
from labmaze import defaults
from labmaze import text_grid
# limitations under the License.
# ============================================================================

"""Text mazes with a fixed, prespecified layout."""


_EMPTY_CELL = ' '


class FixedMazeWithRandomGoals(base.BaseMaze):
  """A maze with fixed layout but randomized spawn points and object positions.

  The maze's layout is prespecified through a newline-terminated string. At
  each call to `regenerate`, the spawn points and object positions are randomly
  drawn from the empty cells within the specified maze layout. The number of
  spawn points and object positions generated is user-specifiable, but is fixed
  across calls to `regenerate`.

  Optionally, the user can also constrain the spawn points and object positions
  to be drawn from a predetermined set. This is done by including the spawn
  and/or object tokens directly into the maze layout string. If the requested
  number of spawns or objects is greater than the number of the respective
  tokens present in the layout string, then additional spawns/objects are
  randomly generated into the remaining empty cells in the layout string.
  """

  def __init__(self, entity_layer, variations_layer=None,
               num_spawns=None,
               spawn_token=defaults.SPAWN_TOKEN,
               num_objects=None,

# Path: labmaze/base.py
# class BaseMaze(metaclass=abc.ABCMeta):
#   def regenerate(self):
#   def entity_layer(self):
#   def variations_layer(self):
#   def height(self):
#   def width(self):
#   def max_variations(self):
#   def spawn_token(self):
#   def object_token(self):
# 
# Path: labmaze/defaults.py

# 
# Path: labmaze/text_grid.py
# class TextGrid(np.ndarray):
#   def __new__(cls, newline_delimited_string):
#   def __str__(self):


# Path: labmaze/fixed_maze.py
import itertools
import numpy as np
from labmaze import base
from labmaze import defaults
from labmaze import text_grid

# limitations under the License.
# ============================================================================

"""Text mazes with a fixed, prespecified layout."""


_EMPTY_CELL = ' '


class FixedMazeWithRandomGoals(base.BaseMaze):
  """A maze with fixed layout but randomized spawn points and object positions.

  The maze's layout is prespecified through a newline-terminated string. At
  each call to `regenerate`, the spawn points and object positions are randomly
  drawn from the empty cells within the specified maze layout. The number of
  spawn points and object positions generated is user-specifiable, but is fixed
  across calls to `regenerate`.

  Optionally, the user can also constrain the spawn points and object positions
  to be drawn from a predetermined set. This is done by including the spawn
  and/or object tokens directly into the maze layout string. If the requested
  number of spawns or objects is greater than the number of the respective
  tokens present in the layout string, then additional spawns/objects are
  randomly generated into the remaining empty cells in the layout string.
  """

  def __init__(self, entity_layer, variations_layer=None,
               num_spawns=None,
               spawn_token=defaults.SPAWN_TOKEN,
               num_objects=None,

               object_token=defaults.OBJECT_TOKEN,