#include <communication_model.h>


Public Member Functions | |
construction / destruction | |
| CommunicationModel () | |
| virtual | ~CommunicationModel () |
| virtual void | set_world (World &) throw () |
| virtual void | init (void) throw () |
world access | |
| virtual World & | world_w (void) throw () |
| virtual const World & | world (void) const throw () |
main interface | |
| virtual bool | can_communicate_bidi (const Node &, const Node &) const =0 throw () |
| virtual bool | can_communicate_uni (const Node &, const Node &) const =0 throw () |
| virtual bool | exists_communication_upper_bound (void) const =0 throw () |
| virtual double | communication_upper_bound (void) const =0 throw () |
| virtual bool | is_status_available_on_construction (void) const =0 throw () |
| virtual void | set_size_hint (double) throw () |
| virtual bool | in_domain (const Node &, const Node &) const throw () |
| Returns true if this instance is able to anser the can_communicate_uni() and can_communicate_bidi() questions. | |
Abstract superclass for communication models. The central method is can_communicate_bidi(), which determines for two specific nodes whether they may exchange messages.
| shawn::CommunicationModel::CommunicationModel | ( | ) |
| virtual shawn::CommunicationModel::~CommunicationModel | ( | ) | [virtual] |
| virtual void shawn::CommunicationModel::set_world | ( | World & | ) | throw () [virtual] |
Sets the world that contains this model, used by World
| virtual void shawn::CommunicationModel::init | ( | void | ) | throw () [virtual] |
called after world is setup and before first node is created. used by World
Reimplemented in shawn::DiskGraphModel, shawn::ManualCommunicationModel, shawn::MultipleCommunicationModel, shawn::PermalinkCommunicationModel, and shawn::StochasticCommunicationModel.
| virtual World& shawn::CommunicationModel::world_w | ( | void | ) | throw () [virtual] |
| virtual const World& shawn::CommunicationModel::world | ( | void | ) | const throw () [virtual] |
| virtual bool shawn::CommunicationModel::can_communicate_bidi | ( | const Node & | , | |
| const Node & | ||||
| ) | const throw () [pure virtual] |
true iff can_communicate_uni(u,v) and can_communicate_uni(v,u), therefore, whether the two nodes may exchange messages. Implemented in shawn::DiskGraphModel, shawn::ManualCommunicationModel, shawn::MultipleCommunicationModel, shawn::PermalinkCommunicationModel, shawn::RimCommModel, and shawn::StochasticCommunicationModel.
| virtual bool shawn::CommunicationModel::can_communicate_uni | ( | const Node & | , | |
| const Node & | ||||
| ) | const throw () [pure virtual] |
true if the first passed node can send messages to the second. Implemented in shawn::DiskGraphModel, shawn::ManualCommunicationModel, shawn::MultipleCommunicationModel, shawn::PermalinkCommunicationModel, shawn::RimCommModel, and shawn::StochasticCommunicationModel.
| virtual bool shawn::CommunicationModel::exists_communication_upper_bound | ( | void | ) | const throw () [pure virtual] |
Implemented in shawn::DiskGraphModel, shawn::ManualCommunicationModel, shawn::MultipleCommunicationModel, shawn::PermalinkCommunicationModel, shawn::RimCommModel, and shawn::StochasticCommunicationModel.
| virtual double shawn::CommunicationModel::communication_upper_bound | ( | void | ) | const throw () [pure virtual] |
if exists_communication_upper_bound(), nodes whose euclidean distance exceeds communication_upper_bound() can never communicate in any direction.
Providing such a value is useful because EdgeModel instances might use the information for geographical caching.
Implemented in shawn::DiskGraphModel, shawn::ManualCommunicationModel, shawn::MultipleCommunicationModel, shawn::PermalinkCommunicationModel, shawn::RimCommModel, and shawn::StochasticCommunicationModel.
| virtual bool shawn::CommunicationModel::is_status_available_on_construction | ( | void | ) | const throw () [pure virtual] |
Implemented in shawn::DiskGraphModel, shawn::ManualCommunicationModel, shawn::MultipleCommunicationModel, shawn::PermalinkCommunicationModel, shawn::RimCommModel, and shawn::StochasticCommunicationModel.
| virtual void shawn::CommunicationModel::set_size_hint | ( | double | ) | throw () [virtual] |
A size hint MAY be provided by the World to the communication model what a "normal" distance in this world could be. This is NO information about the actual communication range of nodes. This is just a hint. Implement this method in your communication model if you want to react to this information.
Reimplemented in shawn::DiskGraphModel.
| virtual bool shawn::CommunicationModel::in_domain | ( | const Node & | , | |
| const Node & | ||||
| ) | const throw () [virtual] |
Returns true if this instance is able to anser the can_communicate_uni() and can_communicate_bidi() questions.
The default implementation returns true. Override this method to implement communication model specific intelligence. This is mainly used in conjunction with MultipleCommunicationModel to combine several CommunicationModels
Reimplemented in shawn::PermalinkCommunicationModel.
1.5.6