FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Friends | List of all members
Spatial::FMTEventContainer Class Reference

Container of FMTEvent handling event comparison and distance calculation efficiently, allowing the user to get events by period, action id and coordinates. More...

#include <FMTEventContainer.h>

Inheritance diagram for Spatial::FMTEventContainer:
[legend]
Collaboration diagram for Spatial::FMTEventContainer:
[legend]

Public Types

typedef std::set< FMTEvent >::value_type value_type
 
typedef std::set< FMTEvent >::iterator iterator
 
typedef std::set< FMTEvent >::const_iterator const_iterator
 
typedef std::set< FMTEvent >::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 FMTEventContainer ()=default
 Default constructor for FMTEventContainer.
 
 ~FMTEventContainer ()=default
 Default destructor for FMTEventContainer.
 
 FMTEventContainer (const FMTEventContainer &rhs)=default
 Copy constructor for FMTEventContainer.
 
FMTEventContaineroperator= (const FMTEventContainer &rhs)=default
 Copy assignment operator for FMTEventContainer.
 
bool operator== (const FMTEventContainer &rhs) const
 Comparison operator for FMTEventContainer.
 
void swap (FMTEventContainer &rhs)
 Swap the events of this container with another one.
 
const_iterator begin () const
 Return a const iterator to the first event.
 
const_iterator end () const
 Return a const iterator past the last event.
 
bool empty () const
 Test whether the container is empty.
 
size_t size () const
 Return the number of events in the container.
 
const_iterator find (const int &period, const FMTCoordinate &coord) const
 Return a const iterator to the first event found with a coordinate at a period.
 
const_iterator find (const FMTEvent &event) const
 Return a const iterator to an event.
 
void insert (const FMTEvent &event)
 Insert an event in the container.
 
void merge (const FMTEventContainer &levents)
 Merge another FMTEventContainer into this one.
 
void erase (const FMTEvent &event)
 Erase an event from the container.
 
const_iterator erase (const const_iterator event)
 Erase an event from the container and return the next iterator.
 
void clear ()
 Clear the content of the container.
 
int lastPeriod () const
 Return the period of the last event in the container.
 
int firstPeriod () const
 Return the period of the first event in the container.
 
void eraseCoordinate (const FMTCoordinate &p_coord, const int &p_periodStart, const std::vector< std::vector< bool > > &p_actionstarget)
 Erase all the coordinates corresponding to a coordinate in the events from a period.
 
std::pair< const_iterator, const_iteratorgetBounds (const int &period) const
 Return a pair of iterators pointing to the first and the last elements of a period.
 
void addAction (const FMTCoordinate &coord, const int &period, const int &actionid, const FMTBindingSpatialAction &binding, size_t p_GraphFamily)
 Add an action at a coordinate, adding to an existing event if possible or aggregating events based on the binding.
 
void addActions (const FMTCoordinate &coord, const int &period, const std::vector< int > &actionids, const std::vector< FMTBindingSpatialAction > &bindings, size_t p_GraphFamily)
 Add actions at a coordinate, adding to an existing event if possible or aggregating events based on the bindings.
 
std::vector< const_iteratorgetEvents (const int &period, const int &action_id) const
 Return the events at a period for an action.
 
std::vector< const_iteratorgetEvents (const int &period, const int &action_id, const FMTCoordinate &minimalcoordinate, const FMTCoordinate &maximalcoordinate) const
 Return the events at a period for an action between a minimal and a maximal coordinate.
 
std::vector< std::vector< const_iterator > > getMultipleEvents (const int &period, const std::vector< int > &action_ids, const FMTCoordinate &minimalcoordinate, const FMTCoordinate &maximalcoordinate) const
 Return the events at a period for multiple actions between a minimal and a maximal coordinate.
 
std::vector< const_iteratorgetEvents (const int &period, const std::vector< int > &actions_id) const
 Return the events at a period for multiple action ids.
 
std::vector< const_iteratorgetEvents (const int &period, const std::vector< bool > &actions_used) const
 Return the events at a period for the used actions.
 
std::vector< const_iteratorgetEvents (const int &period, const std::vector< bool > &actions_used, const FMTCoordinate &minimalcoordinate, const FMTCoordinate &maximalcoordinate) const
 Return the events at a period for the used actions between a minimal and a maximal coordinate.
 
std::vector< const_iteratorgetEvents (const int &period, const FMTCoordinate &coord) const
 Return the events at a period for a coordinate.
 
FMTEventContainer getEventsToErase (const int &fromperiod, const std::vector< std::vector< bool > > &actionstarget, const FMTCoordinate &coord, const size_t &buffer, FMTEventContainer &newevents) const
 Return the events to erase when removing a coordinate, starting from a period based on a buffer around the events, and fill the modified events.
 
FMTEventContainer getEventsToAdd (const FMTCoordinate &coord, const int &period, const int &actionid, const FMTBindingSpatialAction &binding, FMTEventContainer &newevents, size_t p_GraphFamily) const
 Add an action to a coordinate and return the modified events whose infeasibility needs to be recalculated, filling the new events.
 
FMTEventContainer getContainer (std::vector< FMTCoordinate > coordinates, const int &minperiod, const int &maxperiod, const size_t &buffer) const
 Return a subset of the container on the coordinates of interest.
 
FMTEventContainer addUpdate (const FMTEventContainer &newevents, const FMTEventContainer &eventstoremove)
 Update the container by adding the new events and removing the events to remove, used to compute the infeasibility.
 
std::vector< const_iteratorgetEvents (const int &period, const std::set< FMTCoordinate > &territory) const
 Return the events at a period for multiple coordinates.
 
double minimalDistance (const FMTEvent &p_event, const unsigned int &p_distancel, const int &p_period, const std::vector< int > &p_actionsid) const
 Return the minimal distance between an event and the other events for a period, or the distance plus one if the event is not within the distance.
 
double evaluateDistance (const FMTEvent &p_event, const double &p_lowerdistancetoevent, const double &p_upperdistancetoevent, const int &p_period, const std::vector< bool > &p_actionsused, boost::unordered_set< FMTEventRelation > &p_relations) const
 Add up the distances of the events that are within (or not within) a distance range for a period.
 
double evaluateSize (const std::vector< bool > &p_actions, int p_period, size_t p_lowerBound, size_t p_upperBound, bool p_testLower) const
 Evaluate the size infeasibility of the events for a period against a size range.
 
double getDispersion (const std::vector< bool > &p_actions, const FMTSpatialGraphs &p_Graphs, int p_themeId, int p_FirstPeriod, int p_LastPeriod, int p_bound) const
 Evaluate the dispersion infeasibility of the events for a theme and a period range.
 
double getDispersion (int p_RuleId, const FMTSpatialGraphs &p_Graphs, int p_themeId, int p_FirstPeriod, int p_LastPeriod, int p_bound) const
 Evaluate the dispersion infeasibility of the events for a rule, a theme and a period range.
 
std::vector< FMTEventContainer::const_iteratorgetDispersionConflicts (const std::vector< bool > &p_actions, const FMTSpatialGraphs &p_Graphs, int p_themeId, int p_FirstPeriod, int p_LastPeriod, int p_bound) const
 Return the events in dispersion conflict for a theme and a period range.
 
std::vector< FMTEventContainer::const_iteratorgetDispersionConflicts (int p_RuleId, const FMTSpatialGraphs &p_Graphs, int p_themeId, int p_FirstPeriod, int p_LastPeriod, int p_bound) const
 Return the events in dispersion conflict for a rule, a theme and a period range.
 
std::vector< FMTEventContainer::const_iteratorgetEventsOf (int p_RuleId, int p_MinimalPeriod, int p_MaximalPeriod) const
 Return the events of a rule for a period range.
 
- Public Member Functions inherited from Core::FMTObject
 FMTObject ()
 Default constructor for FMTObject.
 
virtual ~FMTObject ()
 Default virtual destructor for FMTObject.
 
 FMTObject (const std::unique_ptr< Exception::FMTExceptionHandler > exhandler)
 Construct a FMTObject passing in the exception handler of another FMTObject.
 
 FMTObject (const FMTObject &rhs)
 Copy constructor for FMTObject.
 
FMTObjectoperator= (const FMTObject &rhs)
 Copy assignment operator for FMTObject.
 
virtual void passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger)
 Pass in the logger of another FMTObject.
 
void passInExceptionHandler (const std::unique_ptr< Exception::FMTExceptionHandler > &exhandler)
 Pass in the exception handler of another FMTObject.
 
void redirectLogToFile (const std::string &location)
 Redirect the log to a specific file, appending to it.
 
virtual void setDefaultLogger ()
 Create and set a default logger to the FMTObject.
 
virtual void setQuietLogger ()
 Create and set a quiet logger to the FMTObject.
 
virtual void setTaskLogger ()
 Create and set a task logger to the FMTObject.
 
virtual void setDebugLogger ()
 Create and set a debug logger to the FMTObject.
 
void setDefaultExceptionHandler ()
 Create and set a default exception handler to the FMTObject.
 
void setQuietExceptionHandler ()
 Create and set a quiet exception handler to the FMTObject.
 
void setDebugExceptionHandler ()
 Create and set a debug exception handler to the FMTObject.
 
void setFreeExceptionHandler ()
 Create and set a free exception handler to the FMTObject.
 
void disableNestedExceptions ()
 Disable the nested exception throw of the exception handler.
 
void enableNestedExceptions ()
 Enable the nested exception throw of the exception handler.
 
void setErrorsToWarnings (const std::vector< Exception::FMTexc > &errors)
 Set a list of errors to be cast to warnings on the exception handler.
 
void setMaxWarningsBeforeSilenced (const size_t &maxwarningcount)
 Set the number of warnings raised before being silenced.
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::FMTObject
static Logging::FMTLoggergetLogger ()
 get a pointer to the actual logger.
 
static Exception::FMTExceptionHandlergetExceptionHandler ()
 get a pointer to the actual exception handler.
 
static std::string getRuntimeLocation ()
 Return the location of the FMT shared library.
 
static unsigned long long getAvailableMemory ()
 Return the available memory in bytes.
 
static void setTerminateStack ()
 will write the stack in the log when terminate called and raise a function failed.
 
static void setAbortStack ()
 will write the stack in the log when abort called with SIGABRT and raise a function failed.
 
- Protected Member Functions inherited from Core::FMTObject
template<class Archive >
void forceSave (Archive &ar, const unsigned int version) const
 Force the serialization to save useful information, which the default FMTObject serialization does not.
 
template<class Archive >
void forceLoad (Archive &ar, const unsigned int version)
 Force the serialization to load useful information, which the default FMTObject serialization does not.
 
void checkSignals () const
 Check if the user has sent a ctrl-c signal using boost::python to FMT.
 
void setCplHandler ()
 Pass the FMT exception handler to the GDAL exception handler (GDAL only).
 
- Static Protected Member Functions inherited from Core::FMTObject
static std::chrono::time_point< std::chrono::high_resolution_clock > getClock ()
 Return a clock of the current time.
 
template<class chrono >
static double getDuration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 Return the time elapsed since a start clock as a double.
 
static std::string getDurationInSeconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 Return the time elapsed since a start clock in seconds as a string.
 
static void _logStack ()
 Log the stack trace...
 
static void _terminate ()
 Raise an error with the boost stacktrace.
 
static void _abort (int p_signal)
 Raise an error with the boost stacktrace on abort.
 
- Static Protected Attributes inherited from Core::FMTObject
static std::unique_ptr< Exception::FMTExceptionHandler_exhandler
 A shared pointer to the exception handler.
 
static std::unique_ptr< Logging::FMTLogger_logger
 A shared pointer to the logger.
 

Detailed Description

Container of FMTEvent handling event comparison and distance calculation efficiently, allowing the user to get events by period, action id and coordinates.

One container can hold all the events of a model, sorted by period, centroid, action id and finally size; coordinates can be added and removed by period and action.

Member Typedef Documentation

◆ const_iterator

typedef std::set<FMTEvent>::const_iterator Spatial::FMTEventContainer::const_iterator

◆ const_reverse_iterator

typedef std::set<FMTEvent>::const_reverse_iterator Spatial::FMTEventContainer::const_reverse_iterator

◆ iterator

typedef std::set<FMTEvent>::iterator Spatial::FMTEventContainer::iterator

◆ value_type

typedef std::set<FMTEvent>::value_type Spatial::FMTEventContainer::value_type

Constructor & Destructor Documentation

◆ FMTEventContainer() [1/2]

Spatial::FMTEventContainer::FMTEventContainer ( )
default

Default constructor for FMTEventContainer.

◆ ~FMTEventContainer()

Spatial::FMTEventContainer::~FMTEventContainer ( )
default

Default destructor for FMTEventContainer.

◆ FMTEventContainer() [2/2]

Spatial::FMTEventContainer::FMTEventContainer ( const FMTEventContainer rhs)
default

Copy constructor for FMTEventContainer.

Parameters
[in]rhsthe FMTEventContainer to copy.

Member Function Documentation

◆ addAction()

void Spatial::FMTEventContainer::addAction ( const FMTCoordinate coord,
const int &  period,
const int &  actionid,
const FMTBindingSpatialAction binding,
size_t  p_GraphFamily 
)

Add an action at a coordinate, adding to an existing event if possible or aggregating events based on the binding.

Parameters
[in]coordthe coordinate.
[in]periodthe period.
[in]actionidthe action id.
[in]bindingthe binding spatial action.
[in]p_GraphFamilythe graph family.

◆ addActions()

void Spatial::FMTEventContainer::addActions ( const FMTCoordinate coord,
const int &  period,
const std::vector< int > &  actionids,
const std::vector< FMTBindingSpatialAction > &  bindings,
size_t  p_GraphFamily 
)

Add actions at a coordinate, adding to an existing event if possible or aggregating events based on the bindings.

The bindings must be the size of the vector of actions in the model because the action ids are used to find the right ones.

Parameters
[in]coordthe coordinate.
[in]periodthe period.
[in]actionidsthe action ids.
[in]bindingsthe binding spatial actions.
[in]p_GraphFamilythe graph family.

◆ addUpdate()

FMTEventContainer Spatial::FMTEventContainer::addUpdate ( const FMTEventContainer newevents,
const FMTEventContainer eventstoremove 
)

Update the container by adding the new events and removing the events to remove, used to compute the infeasibility.

Parameters
[in]neweventsthe new events.
[in]eventstoremovethe events to remove.
Returns
the updated container.

◆ begin()

const_iterator Spatial::FMTEventContainer::begin ( ) const

Return a const iterator to the first event.

Returns
a const iterator to the first event.

◆ clear()

void Spatial::FMTEventContainer::clear ( )

Clear the content of the container.

◆ empty()

bool Spatial::FMTEventContainer::empty ( ) const

Test whether the container is empty.

Returns
true if the container is empty else false.

◆ end()

const_iterator Spatial::FMTEventContainer::end ( ) const

Return a const iterator past the last event.

Returns
a const iterator past the last event.

◆ erase() [1/2]

const_iterator Spatial::FMTEventContainer::erase ( const const_iterator  event)

Erase an event from the container and return the next iterator.

Parameters
[in]eventthe iterator to the event to erase.
Returns
the next iterator.

◆ erase() [2/2]

void Spatial::FMTEventContainer::erase ( const FMTEvent event)

Erase an event from the container.

Parameters
[in]eventthe event to erase.

◆ eraseCoordinate()

void Spatial::FMTEventContainer::eraseCoordinate ( const FMTCoordinate p_coord,
const int &  p_periodStart,
const std::vector< std::vector< bool > > &  p_actionstarget 
)

Erase all the coordinates corresponding to a coordinate in the events from a period.

Parameters
[in]p_coordthe coordinate.
[in]p_periodStartthe first period.
[in]p_actionstargetthe action targets.

◆ evaluateDistance()

double Spatial::FMTEventContainer::evaluateDistance ( const FMTEvent p_event,
const double &  p_lowerdistancetoevent,
const double &  p_upperdistancetoevent,
const int &  p_period,
const std::vector< bool > &  p_actionsused,
boost::unordered_set< FMTEventRelation > &  p_relations 
) const

Add up the distances of the events that are within (or not within) a distance range for a period.

Parameters
[in]p_eventthe event.
[in]p_lowerdistancetoeventthe lower distance to the event.
[in]p_upperdistancetoeventthe upper distance to the event.
[in]p_periodthe period.
[in]p_actionsusedthe used actions.
[in,out]p_relationsthe event relations.
Returns
the evaluated distance.

◆ evaluateSize()

double Spatial::FMTEventContainer::evaluateSize ( const std::vector< bool > &  p_actions,
int  p_period,
size_t  p_lowerBound,
size_t  p_upperBound,
bool  p_testLower 
) const

Evaluate the size infeasibility of the events for a period against a size range.

Parameters
[in]p_actionsthe actions.
[in]p_periodthe period.
[in]p_lowerBoundthe lower size bound.
[in]p_upperBoundthe upper size bound.
[in]p_testLowerif true tests the lower bound.
Returns
the size infeasibility.

◆ find() [1/2]

const_iterator Spatial::FMTEventContainer::find ( const FMTEvent event) const

Return a const iterator to an event.

Parameters
[in]eventthe event.
Returns
a const iterator to the event.

◆ find() [2/2]

const_iterator Spatial::FMTEventContainer::find ( const int &  period,
const FMTCoordinate coord 
) const

Return a const iterator to the first event found with a coordinate at a period.

Parameters
[in]periodthe period.
[in]coordthe coordinate.
Returns
a const iterator to the event.

◆ firstPeriod()

int Spatial::FMTEventContainer::firstPeriod ( ) const

Return the period of the first event in the container.

Returns
the first period.

◆ getBounds()

std::pair< const_iterator, const_iterator > Spatial::FMTEventContainer::getBounds ( const int &  period) const

Return a pair of iterators pointing to the first and the last elements of a period.

Parameters
[in]periodthe period.
Returns
the pair of iterators.

◆ getContainer()

FMTEventContainer Spatial::FMTEventContainer::getContainer ( std::vector< FMTCoordinate coordinates,
const int &  minperiod,
const int &  maxperiod,
const size_t &  buffer 
) const

Return a subset of the container on the coordinates of interest.

Parameters
[in]coordinatesthe coordinates.
[in]minperiodthe minimal period.
[in]maxperiodthe maximal period.
[in]bufferthe buffer.
Returns
the container subset.

◆ getDispersion() [1/2]

double Spatial::FMTEventContainer::getDispersion ( const std::vector< bool > &  p_actions,
const FMTSpatialGraphs p_Graphs,
int  p_themeId,
int  p_FirstPeriod,
int  p_LastPeriod,
int  p_bound 
) const

Evaluate the dispersion infeasibility of the events for a theme and a period range.

Parameters
[in]p_actionsthe actions.
[in]p_Graphsthe spatial graphs.
[in]p_themeIdthe theme id.
[in]p_FirstPeriodthe first period.
[in]p_LastPeriodthe last period.
[in]p_boundthe bound.
Returns
the dispersion infeasibility.

◆ getDispersion() [2/2]

double Spatial::FMTEventContainer::getDispersion ( int  p_RuleId,
const FMTSpatialGraphs p_Graphs,
int  p_themeId,
int  p_FirstPeriod,
int  p_LastPeriod,
int  p_bound 
) const

Evaluate the dispersion infeasibility of the events for a rule, a theme and a period range.

Parameters
[in]p_RuleIdthe rule id.
[in]p_Graphsthe spatial graphs.
[in]p_themeIdthe theme id.
[in]p_FirstPeriodthe first period.
[in]p_LastPeriodthe last period.
[in]p_boundthe bound.
Returns
the dispersion infeasibility.

◆ getDispersionConflicts() [1/2]

std::vector< FMTEventContainer::const_iterator > Spatial::FMTEventContainer::getDispersionConflicts ( const std::vector< bool > &  p_actions,
const FMTSpatialGraphs p_Graphs,
int  p_themeId,
int  p_FirstPeriod,
int  p_LastPeriod,
int  p_bound 
) const

Return the events in dispersion conflict for a theme and a period range.

Parameters
[in]p_actionsthe actions.
[in]p_Graphsthe spatial graphs.
[in]p_themeIdthe theme id.
[in]p_FirstPeriodthe first period.
[in]p_LastPeriodthe last period.
[in]p_boundthe bound.
Returns
the conflicting events.

◆ getDispersionConflicts() [2/2]

std::vector< FMTEventContainer::const_iterator > Spatial::FMTEventContainer::getDispersionConflicts ( int  p_RuleId,
const FMTSpatialGraphs p_Graphs,
int  p_themeId,
int  p_FirstPeriod,
int  p_LastPeriod,
int  p_bound 
) const

Return the events in dispersion conflict for a rule, a theme and a period range.

Parameters
[in]p_RuleIdthe rule id.
[in]p_Graphsthe spatial graphs.
[in]p_themeIdthe theme id.
[in]p_FirstPeriodthe first period.
[in]p_LastPeriodthe last period.
[in]p_boundthe bound.
Returns
the conflicting events.

◆ getEvents() [1/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const FMTCoordinate coord 
) const

Return the events at a period for a coordinate.

Parameters
[in]periodthe period.
[in]coordthe coordinate.
Returns
the events.

◆ getEvents() [2/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const int &  action_id 
) const

Return the events at a period for an action.

Parameters
[in]periodthe period.
[in]action_idthe action id.
Returns
the events.

◆ getEvents() [3/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const int &  action_id,
const FMTCoordinate minimalcoordinate,
const FMTCoordinate maximalcoordinate 
) const

Return the events at a period for an action between a minimal and a maximal coordinate.

Parameters
[in]periodthe period.
[in]action_idthe action id.
[in]minimalcoordinatethe minimal coordinate.
[in]maximalcoordinatethe maximal coordinate.
Returns
the events.

◆ getEvents() [4/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const std::set< FMTCoordinate > &  territory 
) const

Return the events at a period for multiple coordinates.

Parameters
[in]periodthe period.
[in]territorythe coordinates.
Returns
the events.

◆ getEvents() [5/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const std::vector< bool > &  actions_used 
) const

Return the events at a period for the used actions.

Parameters
[in]periodthe period.
[in]actions_usedthe used actions.
Returns
the events.

◆ getEvents() [6/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const std::vector< bool > &  actions_used,
const FMTCoordinate minimalcoordinate,
const FMTCoordinate maximalcoordinate 
) const

Return the events at a period for the used actions between a minimal and a maximal coordinate.

Parameters
[in]periodthe period.
[in]actions_usedthe used actions.
[in]minimalcoordinatethe minimal coordinate.
[in]maximalcoordinatethe maximal coordinate.
Returns
the events.

◆ getEvents() [7/7]

std::vector< const_iterator > Spatial::FMTEventContainer::getEvents ( const int &  period,
const std::vector< int > &  actions_id 
) const

Return the events at a period for multiple action ids.

Parameters
[in]periodthe period.
[in]actions_idthe action ids.
Returns
the events.

◆ getEventsOf()

std::vector< FMTEventContainer::const_iterator > Spatial::FMTEventContainer::getEventsOf ( int  p_RuleId,
int  p_MinimalPeriod,
int  p_MaximalPeriod 
) const

Return the events of a rule for a period range.

Parameters
[in]p_RuleIdthe rule id.
[in]p_MinimalPeriodthe minimal period.
[in]p_MaximalPeriodthe maximal period.
Returns
the events.

◆ getEventsToAdd()

FMTEventContainer Spatial::FMTEventContainer::getEventsToAdd ( const FMTCoordinate coord,
const int &  period,
const int &  actionid,
const FMTBindingSpatialAction binding,
FMTEventContainer newevents,
size_t  p_GraphFamily 
) const

Add an action to a coordinate and return the modified events whose infeasibility needs to be recalculated, filling the new events.

Parameters
[in]coordthe coordinate.
[in]periodthe period.
[in]actionidthe action id.
[in]bindingthe binding spatial action.
[in,out]neweventsthe new events.
[in]p_GraphFamilythe graph family.
Returns
the events to add.

◆ getEventsToErase()

FMTEventContainer Spatial::FMTEventContainer::getEventsToErase ( const int &  fromperiod,
const std::vector< std::vector< bool > > &  actionstarget,
const FMTCoordinate coord,
const size_t &  buffer,
FMTEventContainer newevents 
) const

Return the events to erase when removing a coordinate, starting from a period based on a buffer around the events, and fill the modified events.

Parameters
[in]fromperiodthe first period.
[in]actionstargetthe action targets.
[in]coordthe coordinate.
[in]bufferthe buffer.
[in,out]neweventsthe modified events resulting from erasing the coordinate.
Returns
the events to erase.

◆ getMultipleEvents()

std::vector< std::vector< const_iterator > > Spatial::FMTEventContainer::getMultipleEvents ( const int &  period,
const std::vector< int > &  action_ids,
const FMTCoordinate minimalcoordinate,
const FMTCoordinate maximalcoordinate 
) const

Return the events at a period for multiple actions between a minimal and a maximal coordinate.

Parameters
[in]periodthe period.
[in]action_idsthe action ids.
[in]minimalcoordinatethe minimal coordinate.
[in]maximalcoordinatethe maximal coordinate.
Returns
the events per action.

◆ insert()

void Spatial::FMTEventContainer::insert ( const FMTEvent event)

Insert an event in the container.

Parameters
[in]eventthe event to insert.

◆ lastPeriod()

int Spatial::FMTEventContainer::lastPeriod ( ) const

Return the period of the last event in the container.

Returns
the last period.

◆ merge()

void Spatial::FMTEventContainer::merge ( const FMTEventContainer levents)

Merge another FMTEventContainer into this one.

Parameters
[in]leventsthe container to merge.

◆ minimalDistance()

double Spatial::FMTEventContainer::minimalDistance ( const FMTEvent p_event,
const unsigned int &  p_distancel,
const int &  p_period,
const std::vector< int > &  p_actionsid 
) const

Return the minimal distance between an event and the other events for a period, or the distance plus one if the event is not within the distance.

Mainly used to compute the penalty of simulated annealing models.

Parameters
[in]p_eventthe event.
[in]p_distancelthe distance.
[in]p_periodthe period.
[in]p_actionsidthe action ids.
Returns
the minimal distance.

◆ operator=()

FMTEventContainer & Spatial::FMTEventContainer::operator= ( const FMTEventContainer rhs)
default

Copy assignment operator for FMTEventContainer.

Parameters
[in]rhsthe FMTEventContainer to copy.
Returns
a reference to this FMTEventContainer.

◆ operator==()

bool Spatial::FMTEventContainer::operator== ( const FMTEventContainer rhs) const

Comparison operator for FMTEventContainer.

Parameters
[in]rhsthe FMTEventContainer to compare to.
Returns
true if both containers are equal else false.

◆ size()

size_t Spatial::FMTEventContainer::size ( ) const

Return the number of events in the container.

Returns
the container size.

◆ swap()

void Spatial::FMTEventContainer::swap ( FMTEventContainer rhs)

Swap the events of this container with another one.

Parameters
[in,out]rhsthe FMTEventContainer to swap with.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

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