FMT 0.9.8
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

#include <FMTeventcontainer.hpp>

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 ()
 
 ~FMTeventcontainer ()=default
 
 FMTeventcontainer (const FMTeventcontainer &rhs)
 
FMTeventcontaineroperator= (const FMTeventcontainer &rhs)
 
bool operator== (const FMTeventcontainer &rhs) const
 
void swap (FMTeventcontainer &rhs)
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
size_t size () const
 
const_iterator find (const int &period, const FMTcoordinate &coord) const
 
const_iterator find (const FMTevent &event) const
 
void insert (const FMTevent &event)
 
void merge (const FMTeventcontainer &levents)
 
void erase (const FMTevent &event)
 
const_iterator erase (const const_iterator event)
 
void clear ()
 
int lastperiod () const
 
int firstperiod () const
 
void erasecoordinate (const FMTcoordinate &coord, const int &periodstart, const std::vector< std::vector< bool > > &actionstarget)
 
std::pair< const_iterator, const_iteratorgetbounds (const int &period) const
 
void addaction (const FMTcoordinate &coord, const int &period, const int &actionid, const FMTbindingspatialaction &binding)
 
void addactions (const FMTcoordinate &coord, const int &period, const std::vector< int > &actionids, const std::vector< FMTbindingspatialaction > &bindings)
 
std::vector< const_iteratorgetevents (const int &period, const int &action_id) const
 
std::vector< const_iteratorgetevents (const int &period, const int &action_id, const FMTcoordinate &minimalcoordinate, const FMTcoordinate &maximalcoordinate) const
 
std::vector< std::vector< const_iterator > > getmultipleevents (const int &period, const std::vector< int > &action_ids, const FMTcoordinate &minimalcoordinate, const FMTcoordinate &maximalcoordinate) const
 
std::vector< const_iteratorgetevents (const int &period, const std::vector< int > &actions_id) const
 
std::vector< const_iteratorgetevents (const int &period, const std::vector< bool > &actions_used) const
 
std::vector< const_iteratorgetevents (const int &period, const std::vector< bool > &actions_used, const FMTcoordinate &minimalcoordinate, const FMTcoordinate &maximalcoordinate) const
 
std::vector< const_iteratorgetevents (const int &period, const FMTcoordinate &coord) const
 
FMTeventcontainer geteventstoerase (const int &fromperiod, const std::vector< std::vector< bool > > &actionstarget, const FMTcoordinate &coord, const size_t &buffer, FMTeventcontainer &newevents) const
 
FMTeventcontainer geteventstoadd (const FMTcoordinate &coord, const int &period, const int &actionid, const FMTbindingspatialaction &binding, FMTeventcontainer &newevents) const
 
FMTeventcontainer getcontainer (std::vector< FMTcoordinate > coordinates, const int &minperiod, const int &maxperiod, const size_t &buffer) const
 
FMTeventcontainer addupdate (const FMTeventcontainer &newevents, const FMTeventcontainer &eventstoremove)
 
std::vector< const_iteratorgetevents (const int &period, const std::set< FMTcoordinate > &territory) const
 
double minimaldistance (const FMTevent &, const unsigned int &distancel, const int &period, const std::vector< int > &actionsid) const
 
double evaluatedistance (const FMTevent &, const double &lowerdistancetoevent, const double &upperdistancetoevent, const int &period, const std::vector< bool > &actionsused, boost::unordered_set< FMTeventrelation > &relations) const
 
- Public Member Functions inherited from Core::FMTobject
 FMTobject ()
 
virtual ~FMTobject ()
 
 FMTobject (const std::shared_ptr< Exception::FMTexceptionhandler > exhandler)
 
 FMTobject (const FMTobject &rhs)
 
FMTobjectoperator= (const FMTobject &rhs)
 
virtual void passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger)
 
void passinexceptionhandler (const std::shared_ptr< Exception::FMTexceptionhandler > &exhandler)
 
void redirectlogtofile (const std::string &location)
 
virtual void setdefaultlogger ()
 
virtual void setquietlogger ()
 
virtual void settasklogger ()
 
virtual void setdebuglogger ()
 
void setdefaultexceptionhandler ()
 
void setquietexceptionhandler ()
 
void setdebugexceptionhandler ()
 
void setfreeexceptionhandler ()
 
void disablenestedexceptions ()
 
void enablenestedexceptions ()
 
void seterrorstowarnings (const std::vector< Exception::FMTexc > &errors)
 
void setmaxwarningsbeforesilenced (const size_t &maxwarningcount)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::FMTobject
static std::string getruntimelocation ()
 
static unsigned long long getavailablememory ()
 
- Protected Member Functions inherited from Core::FMTobject
template<class Archive >
void forcesave (Archive &ar, const unsigned int version) const
 
template<class Archive >
void forceload (Archive &ar, const unsigned int version)
 
void checksignals () const
 
void setCPLhandler ()
 
- Static Protected Member Functions inherited from Core::FMTobject
static std::chrono::time_point< std::chrono::high_resolution_clock > getclock ()
 
template<class chrono >
static double getduration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 
static std::string getdurationinseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 
- Static Protected Attributes inherited from Core::FMTobject
static std::shared_ptr< Exception::FMTexceptionhandler_exhandler
 A shared pointer to the exception handler.
 
static std::shared_ptr< Logging::FMTlogger_logger
 A shared pointer to the logger.
 

Detailed Description

This class is a container for FMTevent. It's build to handle event comparison or distance calculation in an efficient way by allowing the user to get events by period, action id and/or coordinates. One container can hold all events for a model. They are sorted by period, centroid, action_id and finally by size. You can remove FMTcoordinate and add FMTcoordinate 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 constructor

◆ ~FMTeventcontainer()

Spatial::FMTeventcontainer::~FMTeventcontainer ( )
default

Destructor

◆ FMTeventcontainer() [2/2]

Spatial::FMTeventcontainer::FMTeventcontainer ( const FMTeventcontainer rhs)

Copy constructor

Member Function Documentation

◆ addaction()

void Spatial::FMTeventcontainer::addaction ( const FMTcoordinate coord,
const int &  period,
const int &  actionid,
const FMTbindingspatialaction binding 
)

◆ addactions()

void Spatial::FMTeventcontainer::addactions ( const FMTcoordinate coord,
const int &  period,
const std::vector< int > &  actionids,
const std::vector< FMTbindingspatialaction > &  bindings 
)

◆ addupdate()

FMTeventcontainer Spatial::FMTeventcontainer::addupdate ( const FMTeventcontainer newevents,
const FMTeventcontainer eventstoremove 
)

◆ begin()

const_iterator Spatial::FMTeventcontainer::begin ( ) const
inline

Return a const iterator to the first FMTevent in events.

◆ clear()

void Spatial::FMTeventcontainer::clear ( )
inline

Clear content of the container.

◆ empty()

bool Spatial::FMTeventcontainer::empty ( ) const
inline

Test whether the container is empty.

◆ end()

const_iterator Spatial::FMTeventcontainer::end ( ) const
inline

Return a const iterator to the past-the-end element in events.

◆ erase() [1/2]

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

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

◆ erase() [2/2]

void Spatial::FMTeventcontainer::erase ( const FMTevent event)

Erase an event from the container.

◆ erasecoordinate()

void Spatial::FMTeventcontainer::erasecoordinate ( const FMTcoordinate coord,
const int &  periodstart,
const std::vector< std::vector< bool > > &  actionstarget 
)

◆ evaluatedistance()

double Spatial::FMTeventcontainer::evaluatedistance ( const FMTevent ,
const double &  lowerdistancetoevent,
const double &  upperdistancetoevent,
const int &  period,
const std::vector< bool > &  actionsused,
boost::unordered_set< FMTeventrelation > &  relations 
) const

The function add each distance from the event if the even is within the ditancetoevent for a given period if within = true. If within = false the if the event is not within the distance it will add up the distances.

◆ find() [1/2]

const_iterator Spatial::FMTeventcontainer::find ( const FMTevent event) const
inline

Get const iterator to the element.

◆ find() [2/2]

const_iterator Spatial::FMTeventcontainer::find ( const int &  period,
const FMTcoordinate coord 
) const

Get const iterator to the first event found with the coord at the period specified.

◆ firstperiod()

int Spatial::FMTeventcontainer::firstperiod ( ) const

◆ getbounds()

std::pair< const_iterator, const_iterator > Spatial::FMTeventcontainer::getbounds ( const int &  period) const

◆ getcontainer()

FMTeventcontainer Spatial::FMTeventcontainer::getcontainer ( std::vector< FMTcoordinate coordinates,
const int &  minperiod,
const int &  maxperiod,
const size_t &  buffer 
) const

◆ getevents() [1/7]

std::vector< const_iterator > Spatial::FMTeventcontainer::getevents ( const int &  period,
const FMTcoordinate coord 
) const

◆ getevents() [2/7]

std::vector< const_iterator > Spatial::FMTeventcontainer::getevents ( const int &  period,
const int &  action_id 
) const

◆ getevents() [3/7]

std::vector< const_iterator > Spatial::FMTeventcontainer::getevents ( const int &  period,
const int &  action_id,
const FMTcoordinate minimalcoordinate,
const FMTcoordinate maximalcoordinate 
) const

◆ getevents() [4/7]

std::vector< const_iterator > Spatial::FMTeventcontainer::getevents ( const int &  period,
const std::set< FMTcoordinate > &  territory 
) const

◆ getevents() [5/7]

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

◆ 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

◆ getevents() [7/7]

std::vector< const_iterator > Spatial::FMTeventcontainer::getevents ( const int &  period,
const std::vector< int > &  actions_id 
) const

◆ geteventstoadd()

FMTeventcontainer Spatial::FMTeventcontainer::geteventstoadd ( const FMTcoordinate coord,
const int &  period,
const int &  actionid,
const FMTbindingspatialaction binding,
FMTeventcontainer newevents 
) const

◆ 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

◆ 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

◆ insert()

void Spatial::FMTeventcontainer::insert ( const FMTevent event)
inline

Insert an event in the container.

◆ lastperiod()

int Spatial::FMTeventcontainer::lastperiod ( ) const

◆ merge()

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

Merge two FMTeventcontainer

◆ minimaldistance()

double Spatial::FMTeventcontainer::minimaldistance ( const FMTevent ,
const unsigned int &  distancel,
const int &  period,
const std::vector< int > &  actionsid 
) const

This function is used when we want to verify if the event is within a certain distance from other events. If it's not, the specified distance distance+1 is return, else the minimal distance is return. It's principally use to calculate penalty for simulated annealing models.

◆ operator=()

FMTeventcontainer & Spatial::FMTeventcontainer::operator= ( const FMTeventcontainer rhs)

Copy assignment operator

◆ operator==()

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

Comparison operator equal to

◆ size()

size_t Spatial::FMTeventcontainer::size ( ) const
inline

Return container size.

◆ swap()

void Spatial::FMTeventcontainer::swap ( FMTeventcontainer rhs)

Exchange contents of events with the content of rhs.events

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: