Bases: _LinkNodeCell, BaseModelElement, ActorProtocol
A patch cell of a RasterLayer.
Subclassing this class to create a custom cell.
When class attribute max_agents is assigned,
the agents property will be limited to the number of agents.
Attributes:
| Name | Type | Description |
|---|---|---|
agents |
_CellAgentsContainer
|
The agents located at here. |
layer |
PatchModule
|
The |
Source code in abses/space/cells.py
get ¶
Gets the value of an attribute or registered property. Automatically update the value if it is the dynamic variable of the layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attr
|
str
|
The name of attribute to get. |
required |
target
|
Optional[TargetName]
|
Optional target name. |
None
|
default
|
Any
|
Default value if attribute is not found. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The value of the attribute. |
Raises:
| Type | Description |
|---|---|
AttributeError
|
Attribute value of the associated patch cell. |
Source code in abses/space/cells.py
neighboring ¶
Get the grid around the patch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
moore
|
bool
|
Whether to include the Moore neighborhood. |
False
|
radius
|
int
|
The radius of the neighborhood. |
1
|
include_center
|
bool
|
Whether to include the center cell. |
False
|
annular
|
bool
|
Whether to use an annular neighborhood. |
False
|
Returns:
| Type | Description |
|---|---|
ActorsList['PatchCell']
|
ActorsList[PatchCell]: The neighboring cells. |