Methods
|
|
|
|
__init__
|
__init__ ( self )
|
|
average
|
average ( self, address )
The average of the neighbors' states.
|
|
countNonZero
|
countNonZero ( self, address )
Count the number of neighbors with state zero.
|
|
countWith
|
countWith (
self,
address,
state,
)
Count the number of neighbors with given state.
|
|
countZero
|
countZero ( self, address )
Count the number of neighbors with state zero.
|
|
findAllWith
|
findAllWith (
self,
address,
state,
)
Return list of indexes of neighbors with the given state.
|
|
findFirstWith
|
findFirstWith (
self,
address,
state,
)
Finds index (into neighbor list) of first neighbor with given
state, or None.
|
|
hasNonZero
|
hasNonZero ( self, address )
Do any neighbors have nonzero state?
|
|
hasWith
|
hasWith (
self,
address,
state,
)
Do any neighbors have the given state?
|
|
hasZero
|
hasZero ( self, address )
Do any neighbors have zero state?
|
|
inclusiveAverage
|
inclusiveAverage ( self, address )
The average of the neighbors' state, including this ones.
|
|
inclusiveStates
|
inclusiveStates ( self, address )
Return the list of cell values for all neighbors, including this
(at the end).
|
|
inclusiveSum
|
inclusiveSum ( self, address )
Sum the states of the neighboring cells as well as this one.
|
|
neighborhood
|
neighborhood ( self )
Return the number of neighbors in the neighborhood; this method
should raise if the neighbor count varies.
|
|
neighbors
|
neighbors ( self, address )
Return a list of addresses which are neighbors. This is the main
entry point for determing neighborhoods.
|
|
randomState
|
randomState ( self, address )
Return a random neighbor's state.
|
|
reduce
|
reduce (
self,
address,
func,
initial=0,
)
Do an arbitrary reduction of the states.
|
|
states
|
states ( self, address )
Return the list of cell values for all neighbors.
|
|
sum
|
sum ( self, address )
Sum the states of the neighboring cells.
|