| Trees | Index | Help |
|
|---|
| Package svs_simulation :: Package terrain :: Module base_classes :: Class Partition |
|
GenericTerrainObject --+
|
Partition
Represents a section of a terrain.
The partition handles objects and structures within the terrain.| Method Summary | |
|---|---|
Returns string representation of partition. | |
Adds a new agent to the partition. | |
Adds a new object to the partition. | |
Adds a new structure to the partition. | |
Clears tiles representation for structure. | |
Clears tiles representation for structure. | |
Checks if point is within bounds of partition. | |
Checks of structure with given name alreday exists, and returns this, iof not creates a new structure. | |
Creates empty tile set for partition. | |
Applies encoded data to self. | |
Constructs classes from encoded data of agents within partition. | |
Constructs classes from encoded data of objects within partition. | |
Constructs classes from encoded data of structures within partition. | |
| dict |
Returns encoded model of data within partition. |
| dict |
Returns encoded model of agents within partition. |
| dict |
Returns encoded model of objects within partition. |
| dict |
Returns encoded model of structures within partition. |
| array |
Returns a list of agents that lie within the specified bounds. |
| array |
Returns a list of objects that lie within the specified bounds. |
Returns structure containing specified coordinates. | |
| array |
Returns a list of structures that lie within the specified bounds. |
| array |
Returns a list of structures that lie within the specified bounds and whose density is greater then or equal to the specified density. |
| array |
Returns a list of entities that lie within the specified bounds and are tagged. |
Tests if any obstacles exist in specified area. | |
Checks if specified area intersects with partition. | |
Creates tiles representation for object. | |
Creates tiles representation for structure. | |
Removes an existing agent from the partition. | |
Removes an existing object from the partition. | |
Removes an existing structure from the partition. | |
Checks the bounds of the partition match its contents. | |
setup(self,
name,
terrain,
bounds,
spaceX,
spaceY,
margin)
| |
Forwards and update message to components in the partition. | |
| Inherited from GenericTerrainObject | |
| |
Adds entity to terrain object. | |
Adds new graph to object. | |
Returns maximum x coordinate from bounds. | |
Returns maximum y coordinate from bounds. | |
Returns minimum x coordinate from bounds. | |
Returns minimum y coordinate from bounds. | |
Returns named graph. | |
Adds entity to terrain object. | |
| Method Details |
|---|
__str__(self)
Returns string representation of partition.
|
addAgent(self, agent)Adds a new agent to the partition. |
addObject(self, obj)Adds a new object to the partition. |
addStructure(self, structure)Adds a new structure to the partition. Every structure must have a unique name. If a structure is added with an existing name it is rejected. |
clearObjectFromTiles(self, obj)Clears tiles representation for structure. |
clearStructureFromTiles(self, structure)Clears tiles representation for structure. |
containsPoint(self, x, y)Checks if point is within bounds of partition. |
createStructureFromName(self, structureName)Checks of structure with given name alreday exists, and returns this, iof not creates a new structure. |
createTiles(self, tilesX, tilesY)Creates empty tile set for partition. |
decode(self, data, terrain=None)Applies encoded data to self. |
decodeAgents(self, data)Constructs classes from encoded data of agents within partition.
|
decodeObjects(self, data)Constructs classes from encoded data of objects within partition.
|
decodeStructures(self, data)Constructs classes from encoded data of structures within partition.
|
encode(self, structures=True, objects=True, agents=False)Returns encoded model of data within partition.
|
encodeAgents(self)Returns encoded model of agents within partition.
|
encodeObjects(self)Returns encoded model of objects within partition.
|
encodeStructures(self)Returns encoded model of structures within partition.
|
getAgentsInArea(self, minX, minY, maxX, maxY, returnTagged=False)Returns a list of agents that lie within the specified bounds.
|
getObjectsInArea(self, minX, minY, maxX, maxY, returnTagged=False)Returns a list of objects that lie within the specified bounds.
|
getStructureAtPoint(self, x, y)Returns structure containing specified coordinates. ReturnsNone if not found.
|
getStructuresInArea(self, minX, minY, maxX, maxY, returnTagged=False)Returns a list of structures that lie within the specified bounds.
|
getStructuresInAreaWithDensity(self, minX, minY, maxX, maxY, density=0.0)Returns a list of structures that lie within the specified bounds and whose density is greater then or equal to the specified density.
|
getTaggedEntitiesInArea(self, minX, minY, maxX, maxY)Returns a list of entities that lie within the specified bounds and are tagged. This returns a list including agents, objects and structures.
|
hasObstaclesInArea(self, minX, minY, maxX, maxY)Tests if any obstacles exist in specified area. ReturnsTrue if there are, False
otherwise.
|
intersects(self, minX, minY, maxX, maxY)Checks if specified area intersects with partition. |
mapObjectToTiles(self, obj)Creates tiles representation for object. |
mapStructureToTiles(self, structure)Creates tiles representation for structure. |
removeAgent(self, agent)Removes an existing agent from the partition. |
removeObject(self, obj)Removes an existing object from the partition. |
removeStructure(self, structure)Removes an existing structure from the partition. |
resolveBounds(self)Checks the bounds of the partition match its contents. |
update(self, timeInterval)Forwards and update message to components in the partition. |
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Thu Oct 20 15:30:28 2005 | http://epydoc.sf.net |