4-connected grids with primitives like obstacles and goals.
|
__init__(self,
gw_desc=None,
prefix=' Y ' )
Load gridworld described in given string, or make empty instance. |
|
|
|
__eq__(self,
other)
Test for equality. |
|
|
|
|
|
|
|
__getitem__(self,
key,
use_next=False,
nonbool=True)
Return variable name corresponding to this cell. |
|
|
|
|
|
copy(self)
Deep-copy GridWorld instance. |
|
|
|
state(self,
key,
offset=( 0, 0) ,
nonbool=True)
Return dictionary form of state with keys of variable names. |
|
|
|
is_empty(self,
coord,
extend=False)
Is cell at coord empty? |
|
|
|
mark_occupied(self,
coord)
Mark cell at coord as statically (permanently) occupied. |
|
|
|
mark_empty(self,
coord)
Mark cell at coord as empty. |
|
|
|
is_reachable(self,
start,
stop)
Decide whether there is a path from start cell to stop. |
|
|
|
plot(self,
font_pt=18,
show_grid=False,
grid_width=2,
troll_list=None,
axes=None)
Draw figure depicting this gridworld. |
|
|
|
pretty(self,
show_grid=False,
line_prefix='
' ,
path=None,
goal_order=False)
Return pretty-for-printing string. |
|
|
|
size(self)
Return size of gridworld as a tuple in row-major order. |
|
|
|
loads(self,
gw_desc)
Reincarnate using given gridworld description string. |
|
|
|
load(self,
gw_file)
Read description from given file. |
|
|
|
dumps(self,
line_prefix='
' )
Dump gridworld description string. |
|
|
GridWorld
|
dump_subworld(self,
size,
offset=( 0, 0) ,
prefix=' Y ' ,
extend=False)
Generate new GridWorld instance from part of current one. |
|
|
PropPreservingPartition
|
dump_ppartition(self,
side_lengths=( 1.0, 1.0) ,
offset=( 0.0, 0.0) ,
nonbool=True)
Return proposition-preserving partition from this gridworld. |
|
|
GRSpec
|
spec(self,
offset=( 0, 0) ,
controlled_dyn=True,
nonbool=True)
Return GRSpec instance describing this gridworld. |
|
|
GridWorld
|
scale(self,
xf=1,
yf=1)
Return a new gridworld equivalent to this but scaled by integer
factor (xf, yf). |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|