#include <permalink_communication_model_factory.h>


Public Member Functions | |
| virtual | ~PermalinkCommunicationModelFactory () |
| virtual CommunicationModel * | create (const SimulationController &) const throw () |
| virtual std::string | name (void) const throw () |
| virtual std::string | description (void) const throw () |
Protected Member Functions | |
| virtual void | init_from_tags (const SimulationController &, PermalinkCommunicationModel &plcm) const throw () |
This instance will be configured by tags attached to the SimulationEnvironment. A TagGroup named 'permalink' can be present in the SimulationEnvironment. If not present, no permanent links will be set. You can add these link manually by calling PermalinkCommunicationModel::add_edge().
If present, this tag group must contain StringBoolMapTag instances for each node that should have a permanent connection to another node. The name of the map must match Node::label(). Each StringBoolMapTag entry creates a link, e.g. In a map named v00, the entry [v01,false] will enable a unidirectional link from node v00 to node v01 and [v02,true] will create a bidirectional entry v00 <-> v02, etc.
If you want to specify the links in the xml configuration file, an example configuration might look like this:
<scenario>
<environment>
<tag type="group" name="permalink">
<tag type="map-string-bool" name="v00"> <entry index="v01" value="false" /> <entry index="v02" value="true" /> </tag>
<tag type="map-string-bool" name="v01"> <entry index="v00" value="false" /> </tag>
</tag>
</environment>
To load these tags into the SimulationEnvironment, use the prepare_world task with the configuration option $env_config and specify the file. This may also be an arbitrary xml file as long as an xml fragment is present that resembles the above xml file. Example:
prepare_world [other options] env_config=mylinks.xml
| virtual shawn::PermalinkCommunicationModelFactory::~PermalinkCommunicationModelFactory | ( | ) | [virtual] |
| virtual CommunicationModel* shawn::PermalinkCommunicationModelFactory::create | ( | const SimulationController & | ) | const throw () [virtual] |
Implements shawn::CommunicationModelFactory.
| virtual std::string shawn::PermalinkCommunicationModelFactory::name | ( | void | ) | const throw () [virtual] |
Implements shawn::KeeperManaged.
| virtual std::string shawn::PermalinkCommunicationModelFactory::description | ( | void | ) | const throw () [virtual] |
Implements shawn::KeeperManaged.
| virtual void shawn::PermalinkCommunicationModelFactory::init_from_tags | ( | const SimulationController & | , | |
| PermalinkCommunicationModel & | plcm | |||
| ) | const throw () [protected, virtual] |
1.5.6