8#ifndef FMTEVENT_H_INCLUDED
9#define FMTEVENT_H_INCLUDED
15#include <boost/serialization/serialization.hpp>
16#include <boost/serialization/nvp.hpp>
17#include <boost/serialization/set.hpp>
21class FMTeventrelation;
29 friend class boost::serialization::access;
30 template<
class Archive>
31 void serialize(Archive& ar,
const unsigned int version)
35 ar & BOOST_SERIALIZATION_NVP(action_id);
36 ar & BOOST_SERIALIZATION_NVP(period);
37 ar & BOOST_SERIALIZATION_NVP(elements);
65 inline std::set<FMTcoordinate>::const_iterator
midposition()
const
67 std::set<FMTcoordinate>::const_iterator it = elements.begin();
68 if (elements.size() > 1)
70 const size_t midlocation = (elements.size() / 2);
71 std::advance(it, midlocation);
109 bool empty()
const {
return elements.empty();}
114 size_t size()
const {
return elements.size();}
210 virtual std::vector<std::set<FMTcoordinate>::const_iterator>
ignit(
const size_t& eventmaximalsize,
const std::set<FMTcoordinate>::const_iterator& ignit,
const int& laction_id,
const int& lperiod);
215 virtual bool spread(
const size_t& eventminimalsize,
const size_t& eventmaximalsize,
216 const size_t& neighboringsize,
const std::set<FMTcoordinate>& territory, std::vector<std::set<FMTcoordinate>::const_iterator> active);
250 bool splitevent(
const unsigned int& ldistance, std::vector<FMTevent>& splittedevents)
const;
260 std::vector<std::set<FMTcoordinate>::const_iterator>
getborders()
const;
275 std::set<FMTcoordinate>::const_iterator& thiscoordinate,
276 std::set<FMTcoordinate>::const_iterator& rhscoordinate)
const;
289 return (event.
hash());
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTcoordinate.hpp:25
Definition: FMTevent.hpp:28
FMTeventrelation getrelation(const FMTevent &rhs) const
std::string getstats() const
void setactionid(const int &laction_id)
Definition: FMTevent.hpp:190
virtual bool operator<(const FMTevent &rhs) const
const int & getperiod() const
Definition: FMTevent.hpp:205
size_t size() const
Definition: FMTevent.hpp:114
bool within(const T &dist, const FMTcoordinate &location) const
FMTevent & operator=(const FMTevent &rhs)
void getclosescoordinates(const FMTevent &rhs, std::set< FMTcoordinate >::const_iterator &thiscoordinate, std::set< FMTcoordinate >::const_iterator &rhscoordinate) const
virtual void insert(const FMTcoordinate &newlocation)
bool empty() const
Definition: FMTevent.hpp:109
virtual ~FMTevent()=default
FMTevent(const FMTevent &rhs)
virtual std::vector< std::set< FMTcoordinate >::const_iterator > ignit(const size_t &eventmaximalsize, const std::set< FMTcoordinate >::const_iterator &ignit, const int &laction_id, const int &lperiod)
FMTcoordinate averagecentroid() const
bool operator!=(const FMTevent &rhs) const
virtual bool spread(const size_t &eventminimalsize, const size_t &eventmaximalsize, const size_t &neighboringsize, const std::set< FMTcoordinate > &territory, std::vector< std::set< FMTcoordinate >::const_iterator > active)
int period
Definition: FMTevent.hpp:59
std::vector< FMTcoordinate > getenveloppe() const
bool potentialysplitevent(const FMTcoordinate &coord) const
virtual void erase(const FMTcoordinate &newlocation)
int action_id
Definition: FMTevent.hpp:54
std::set< FMTcoordinate > elements
Definition: FMTevent.hpp:79
static std::string getstatsheader()
virtual bool operator==(const FMTevent &rhs) const
double distance(const FMTevent &rhs) const
bool contain(const FMTcoordinate &coord) const
void setperiod(const int &lperiod)
Definition: FMTevent.hpp:195
std::vector< std::set< FMTcoordinate >::const_iterator > getborders() const
std::set< FMTcoordinate > getterritory(const size_t &distance) const
const int & getactionid() const
Definition: FMTevent.hpp:200
FMTevent(const FMTcoordinate &location, const int &laction_id, const int &lperiod)
std::set< FMTcoordinate >::const_iterator midposition() const
Definition: FMTevent.hpp:65
bool within(const T &dist, const FMTevent &rhs) const
bool splitevent(const unsigned int &ldistance, std::vector< FMTevent > &splittedevents) const
virtual void merge(const FMTevent &event)
Definition: FMTeventrelation.hpp:22
The spatial namespace provides classes for spatialy explicit simulation/optimization based on raster ...
Definition: FMTareaparser.hpp:36
Definition: FMTaction.hpp:364
std::size_t operator()(const Spatial::FMTevent &event) const
Definition: FMTevent.hpp:286