shawn::CommunicationModel Class Reference

Model deciding whether nodes can hear each other. More...

#include <communication_model.h>

Inheritance diagram for shawn::CommunicationModel:

Inheritance graph
[legend]
Collaboration diagram for shawn::CommunicationModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

construction / destruction
 CommunicationModel ()
virtual ~CommunicationModel ()
virtual void set_world (World &) throw ()
virtual void init (void) throw ()
world access
virtual Worldworld_w (void) throw ()
virtual const Worldworld (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.


Detailed Description

Model deciding whether nodes can hear each other.

Abstract superclass for communication models. The central method is can_communicate_bidi(), which determines for two specific nodes whether they may exchange messages.


Constructor & Destructor Documentation

shawn::CommunicationModel::CommunicationModel (  ) 

virtual shawn::CommunicationModel::~CommunicationModel (  )  [virtual]


Member Function Documentation

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]

virtual World& shawn::CommunicationModel::world_w ( void   )  throw () [virtual]

Returns:
the containing writable World

virtual const World& shawn::CommunicationModel::world ( void   )  const throw () [virtual]

Returns:
the containing const World

virtual bool shawn::CommunicationModel::can_communicate_bidi ( const Node ,
const Node  
) const throw () [pure virtual]

Returns:
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]

Returns:
true if the first passed node can send messages to the second.
Warning:
currently, unidirectional links are unsupported. This method is therefore pretty much useless

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]

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]

Returns:
whether the status (i.e., whether two nodes can communicate) is available instantly when nodes are created.

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.


The documentation for this class was generated from the following file:

Generated on Tue Feb 7 00:00:48 2012 for Shawn by  doxygen 1.5.6