8#ifndef FMTeventCONTAINER_H
9#define FMTeventCONTAINER_H
12#include <boost/serialization/serialization.hpp>
13#include <boost/serialization/nvp.hpp>
14#include <boost/serialization/set.hpp>
15#include <unordered_set>
16#include <boost/unordered_set.hpp>
23class FMTbindingspatialaction;
36 friend class boost::serialization::access;
37 template<
class Archive>
38 void serialize(Archive& ar,
const unsigned int version)
40 ar & boost::serialization::make_nvp(
"FMTobject", boost::serialization::base_object<FMTobject>(*
this));
41 ar & BOOST_SERIALIZATION_NVP(events);
45 typedef typename std::set<FMTevent>::value_type
value_type;
46 typedef typename std::set<FMTevent>::iterator
iterator;
93 bool empty()
const {
return events.empty();}
98 size_t size()
const {
return events.size();}
115 events.insert(event);
161 std::pair<const_iterator,const_iterator>
getbounds(
const int& period)
const;
172 void addactions(
const FMTcoordinate& coord,
const int& period,
const std::vector<int>& actionids,
const std::vector<FMTbindingspatialaction>& bindings);
177 std::vector<const_iterator>
getevents(
const int& period,
const int& action_id)
const;
182 std::vector<const_iterator>
getevents(
const int& period,
const int& action_id,
188 std::vector<std::vector<const_iterator>>
getmultipleevents(
const int& period,
const std::vector<int>& action_ids,
194 std::vector<const_iterator>
getevents(
const int& period,
const std::vector<int>& actions_id)
const;
199 std::vector<const_iterator>
getevents(
const int& period,
const std::vector<bool>& actions_used)
const;
204 std::vector<const_iterator>
getevents(
const int& period,
const std::vector<bool>& actions_used,
244 std::vector<const_iterator>
getevents(
const int& period,
const std::set<FMTcoordinate>& territory)
const;
251 double minimaldistance(
const FMTevent&,
const unsigned int& distancel,
const int& period,
const std::vector<int>& actionsid)
const;
258 const double& lowerdistancetoevent,
259 const double& upperdistancetoevent,
260 const int& period,
const std::vector<bool>& actionsused,
261 boost::unordered_set<FMTeventrelation>& relations)
const;
264 std::set<FMTevent> events;
281 void erase(
const FMTcoordinate& coord,
const std::vector<const_iterator>& iterators);
286 void pushaction(
const std::vector<FMTeventcontainer::const_iterator>& iterators,
287 const FMTcoordinate& coord,
const int& period,
const int& actionid,
size_t neighborsize);
292 std::vector<FMTeventcontainer::const_iterator> getaroundevents(
const std::vector<FMTeventcontainer::const_iterator>& iterators,
293 const FMTcoordinate& coord,
const size_t& neighborsize)
const;
298 void nthelements(std::vector<FMTeventcontainer::const_iterator>& iterators,
const FMTcoordinate& coord,
const size_t& nelement)
const;
300 class FMTeventiteratorsorter
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTobject.hpp:50
Definition: FMTbindingspatialaction.hpp:19
Definition: FMTcoordinate.hpp:25
Definition: FMTevent.hpp:28
Definition: FMTeventcontainer.hpp:35
bool empty() const
Definition: FMTeventcontainer.hpp:93
void insert(const FMTevent &event)
Definition: FMTeventcontainer.hpp:113
size_t size() const
Definition: FMTeventcontainer.hpp:98
FMTeventcontainer & operator=(const FMTeventcontainer &rhs)
std::vector< const_iterator > getevents(const int &period, const int &action_id) const
std::pair< const_iterator, const_iterator > getbounds(const int &period) const
std::vector< std::vector< const_iterator > > getmultipleevents(const int &period, const std::vector< int > &action_ids, const FMTcoordinate &minimalcoordinate, const FMTcoordinate &maximalcoordinate) 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
std::vector< const_iterator > getevents(const int &period, const std::vector< int > &actions_id) const
std::set< FMTevent >::value_type value_type
Definition: FMTeventcontainer.hpp:45
void merge(const FMTeventcontainer &levents)
void erase(const FMTevent &event)
std::set< FMTevent >::iterator iterator
Definition: FMTeventcontainer.hpp:46
const_iterator begin() const
Definition: FMTeventcontainer.hpp:83
FMTeventcontainer geteventstoadd(const FMTcoordinate &coord, const int &period, const int &actionid, const FMTbindingspatialaction &binding, FMTeventcontainer &newevents) const
std::vector< const_iterator > getevents(const int &period, const FMTcoordinate &coord) const
FMTeventcontainer getcontainer(std::vector< FMTcoordinate > coordinates, const int &minperiod, const int &maxperiod, const size_t &buffer) const
const_iterator erase(const const_iterator event)
void swap(FMTeventcontainer &rhs)
bool operator==(const FMTeventcontainer &rhs) const
std::vector< const_iterator > getevents(const int &period, const std::vector< bool > &actions_used, const FMTcoordinate &minimalcoordinate, const FMTcoordinate &maximalcoordinate) const
std::vector< const_iterator > getevents(const int &period, const int &action_id, const FMTcoordinate &minimalcoordinate, const FMTcoordinate &maximalcoordinate) const
std::vector< const_iterator > getevents(const int &period, const std::set< FMTcoordinate > &territory) const
std::set< FMTevent >::const_iterator const_iterator
Definition: FMTeventcontainer.hpp:47
FMTeventcontainer addupdate(const FMTeventcontainer &newevents, const FMTeventcontainer &eventstoremove)
const_iterator find(const FMTevent &event) const
Definition: FMTeventcontainer.hpp:108
void clear()
Definition: FMTeventcontainer.hpp:136
FMTeventcontainer(const FMTeventcontainer &rhs)
void erasecoordinate(const FMTcoordinate &coord, const int &periodstart, const std::vector< std::vector< bool > > &actionstarget)
double minimaldistance(const FMTevent &, const unsigned int &distancel, const int &period, const std::vector< int > &actionsid) const
std::vector< const_iterator > getevents(const int &period, const std::vector< bool > &actions_used) const
FMTeventcontainer geteventstoerase(const int &fromperiod, const std::vector< std::vector< bool > > &actionstarget, const FMTcoordinate &coord, const size_t &buffer, FMTeventcontainer &newevents) const
void addaction(const FMTcoordinate &coord, const int &period, const int &actionid, const FMTbindingspatialaction &binding)
const_iterator find(const int &period, const FMTcoordinate &coord) const
~FMTeventcontainer()=default
const_iterator end() const
Definition: FMTeventcontainer.hpp:88
void addactions(const FMTcoordinate &coord, const int &period, const std::vector< int > &actionids, const std::vector< FMTbindingspatialaction > &bindings)
std::set< FMTevent >::const_reverse_iterator const_reverse_iterator
Definition: FMTeventcontainer.hpp:48
The spatial namespace provides classes for spatialy explicit simulation/optimization based on raster ...
Definition: FMTareaparser.hpp:36