#include <TreePolicy.hpp>
Public Member Functions | |
virtual vector< TreeNode * > | constructTree (TreeNode *root)=0 |
int | maxLevel () const |
int | minLevel () const |
![]() | |
template<class T > | |
T * | find (bool setup=true) const |
template<class T > | |
T * | interface (int levels=-999999, bool setup=true) const |
virtual string | itemName () const |
void | setup () |
string | typeAndName () const |
![]() | |
Item (const Item &)=delete | |
virtual | ~Item () |
void | addChild (Item *child) |
const vector< Item * > & | children () const |
virtual void | clearItemListProperty (const PropertyDef *property) |
void | destroyChild (Item *child) |
virtual bool | getBoolProperty (const PropertyDef *property) const |
virtual vector< double > | getDoubleListProperty (const PropertyDef *property) const |
virtual double | getDoubleProperty (const PropertyDef *property) const |
virtual string | getEnumProperty (const PropertyDef *property) const |
virtual int | getIntProperty (const PropertyDef *property) const |
virtual vector< Item * > | getItemListProperty (const PropertyDef *property) const |
virtual Item * | getItemProperty (const PropertyDef *property) const |
virtual string | getStringProperty (const PropertyDef *property) const |
int | getUtilityProperty (string name) const |
virtual void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) |
Item & | operator= (const Item &)=delete |
Item * | parent () const |
virtual void | removeFromItemListProperty (const PropertyDef *property, int index) |
virtual void | setBoolProperty (const PropertyDef *property, bool value) |
virtual void | setDoubleListProperty (const PropertyDef *property, vector< double > value) |
virtual void | setDoubleProperty (const PropertyDef *property, double value) |
virtual void | setEnumProperty (const PropertyDef *property, string value) |
virtual void | setIntProperty (const PropertyDef *property, int value) |
virtual void | setItemProperty (const PropertyDef *property, Item *item) |
virtual void | setStringProperty (const PropertyDef *property, string value) |
void | setUtilityProperty (string name, int value) |
virtual string | type () const |
Protected Member Functions | |
TreePolicy () | |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
Private Types | |
using | BaseType = SimulationItem |
using | ItemType = TreePolicy |
Private Attributes | |
int | _maxLevel |
int | _minLevel |
Friends | |
class | ItemRegistry |
TreePolicy is an abstract class that represents the configurable options and the corresponding implementation mechanisms for constructing spatial tree grids, as a service to the PolicyTreeSpatialGrid class. Encapsulating these policies in a separate class hierarchy allows offering and possibly combining different policies without complicating the TreeSpatialGrid class hierarchy.
The public interface of TreePolicy class offers just a single function that is invoked by the PolicyTreeSpatialGrid class during setup to construct the tree hierarchy and all TreeNode instances in it.
|
inlineprotected |
Default constructor for abstract Item subclass TreePolicy : "a spatial tree grid construction policy" .
This function must be implemented in a subclass. It constructs the hierarchical tree and all (interconnected) nodes forming the tree. All nodes are instances of the same TreeNode subclass as the root node passed as an argument. The function returns a list of pointers to all created nodes (leaf and nonleaf). Ownership of the nodes resides in this returned list (not in the node hierarchy itself) and is thus handed to the caller.
Each (leaf and nonleaf) node is given an identifier (ID) corresponding to its index in the list. The first node in the list is the root node of tree, i.e. the node passed as an argument. By definition, the root node has an ID of zero.
This function also causes the nodes to construct neighbor lists, interconnecting the nodes according to their spatial relationship. The neighbor lists are sorted so that the neighbors with the largest overlapping border area are listed first, increasing (on average) the probability of locating the correct neighbor early in the list.
Implemented in DensityTreePolicy, and SiteListTreePolicy.
|
inline |
This function returns the value of the discoverable integer property maxLevel : "the maximum level of grid refinement" .
The minimum value for this property is "0" .
The maximum value for this property is "99" .
The default value for this property is given by the conditional value expression "OctTreeGrid:7;BinTreeGrid:21" .
|
inline |
This function returns the value of the discoverable integer property minLevel : "the minimum level of grid refinement" .
The minimum value for this property is "0" .
The maximum value for this property is "99" .
The default value for this property is given by the conditional value expression "OctTreeGrid:3;BinTreeGrid:9" .
|
overrideprotectedvirtual |
This function verifies that the maximum level is not below the minimum level.
Reimplemented from SimulationItem.