8#ifndef FMTPATCHRULES_m_included
9#define FMTPATCHRULES_m_included
24 class FMTEventContainer;
26 class FMTSpatialGraphs;
59 static std::vector<FMTPatchRules>
60 getRules(
const std::vector<Core::FMTConstraint>& p_constraints,
61 const std::vector<Core::FMTAction>& p_actions);
78 std::vector<std::set<FMTEvent>::iterator>& p_SmallEvents,
105 FMTPatchRules(
const std::vector<Core::FMTConstraint>& p_constraints,
106 const std::vector<Core::FMTAction>& p_actions,
int p_Id);
114 void _buildPatchRules(
const std::vector<Core::FMTConstraint>& p_constraints,
115 const std::vector<Core::FMTAction>& p_actions,
int p_Id);
123 static std::vector<std::pair<std::vector<int>,
124 std::pair<int,int>>> _getOrderedRules(
const std::vector<Core::FMTConstraint>& p_constraints,
125 const std::vector<Core::FMTAction>& p_actions);
135 template <
typename U>
136 static void _getBounds(
double p_lower,
double p_upper,
137 U& p_NewLower, U& p_NewUpper);
145 bool _tooSmall(
const FMTEvent& p_event,
size_t& p_cost)
const;
153 bool _tooBig(
const FMTEvent& p_event,
size_t& p_cost)
const;
168 bool _isSizeUsed()
const;
174 bool _isAdjacencyUsed()
const;
180 bool _hasMinimalAdjacency()
const;
186 bool _hasMaximalAdjacency()
const;
192 bool _isGroupUsed()
const;
219 size_t m_MinimalAdjacency;
220 size_t m_MaximalAdjacency;
221 size_t m_MinimalSize;
222 size_t m_MaximalSize;
223 size_t m_NeighborSize;
225 int m_MinimalGroupDistance;
226 int m_MaximalGroupDistance;
227 std::vector<int>m_ActionTargets;
Base class of multiple FMT classes holding a shared exception handler pointer and logger.
Definition: FMTObject.h:49
Container of FMTEvent handling event comparison and distance calculation efficiently,...
Definition: FMTEventContainer.h:32
Base class for a spatial event (FMTsaevent or FMTsesevent): a set of FMTCoordinate corresponding to t...
Definition: FMTEvent.h:28
Spatial patch rules used to evaluate and repair the size, adjacency and grouping of events in a spati...
Definition: FMTPatchRules.h:32
void fillTooSmallEvents(std::vector< std::set< FMTEvent >::iterator > &p_SmallEvents, FMTEventContainer &p_events) const
Fill a vector with the events that are too small.
FMTPatchRules & operator=(const FMTPatchRules &rhs)=default
Copy assignment operator for FMTPatchRules.
void fillDispersionEvents(std::vector< std::set< FMTEvent >::iterator > &p_Dispersion, FMTEventContainer &p_events, const FMTSpatialGraphs &p_SpatialGraphs) const
Fill a vector with the events that break the dispersion (adjacency) rules.
FMTPatchRules()=default
Default constructor for FMTPatchRules.
double evaluate(const FMTEventContainer &p_events, const FMTSpatialGraphs &p_SpatialGraphs) const
Evaluate the cost of the patch rules on a container of events.
FMTPatchRules(const FMTPatchRules &rhs)=default
Copy constructor for FMTPatchRules.
static std::vector< FMTPatchRules > getRules(const std::vector< Core::FMTConstraint > &p_constraints, const std::vector< Core::FMTAction > &p_actions)
Build the patch rules from the spatial constraints and the actions.
void fillTooBigEvents(std::vector< std::set< FMTEvent >::iterator > &p_BigEvents, FMTEventContainer &p_events) const
Fill a vector with the events that are too big.
Container of the line graphs of a spatially explicit model, organized by constraint family,...
Definition: FMTSpatialGraphs.h:52
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
Definition: FMTAreaParser.h:40