22 #ifndef _SGPRODUCTPOLICY_HPP
23 #define _SGPRODUCTPOLICY_HPP
25 #include "sgpolicy.hpp"
33 typedef set<SGPolicy,policyComp> SGPolicySet;
55 if (state >=
policies.size() || state<0)
72 if (state >=
policies.size() || state<0)
81 if (state >=
policies.size() || state<0)
90 if (state >=
policies.size() || state<0)
99 for (
int state = 0; state <
policies.size(); state++)
107 for (
int state = 0; state <
policies.size(); state++)
119 for (
int state = 0; state <
policies.size(); state++)
126 std::string
hash()
const;
SGProductPolicy(int _numStates, const SGPoint &_dir)
Constructor.
Definition: sgproductpolicy.hpp:48
Class for storing product policies.
Definition: sgproductpolicy.hpp:39
A policy for the max-min-max algorithm.
Definition: sgpolicy.hpp:34
std::string hash() const
Returns a unique identifier for the product policy.
Definition: sgproductpolicy.cpp:25
void erasePolicy(int state, const SGPolicy &policy)
Removes a policy from the given state.
Definition: sgproductpolicy.hpp:79
vector< double > levels
Definition: sgproductpolicy.hpp:44
const SGPoint & getDir() const
Get method for the direction.
Definition: sgproductpolicy.hpp:62
SGSolve specific exceptions.
Definition: sgexception.hpp:36
Function object for comparing two policies.
Definition: sgproductpolicy.hpp:28
void clear()
Clears the policies in all states.
Definition: sgproductpolicy.hpp:97
@ OUT_OF_BOUNDS
Definition: sgnamespace.hpp:47
int numStates() const
Returns the number of states.
Definition: sgproductpolicy.hpp:129
SGPoint dir
Definition: sgproductpolicy.hpp:43
const vector< double > & getLevels() const
Get method for levels.
Definition: sgproductpolicy.hpp:66
A vector in .
Definition: sgpoint.hpp:35
int dimension() const
Returns the total number of policies, minus the number of states.
Definition: sgproductpolicy.hpp:116
vector< SGPolicySet > policies
Definition: sgproductpolicy.hpp:41
bool isempty() const
Returns whether the policy set is empty in any state.
Definition: sgproductpolicy.hpp:104
void setLevel(int state, double lvl)
Sets the level in a given state.
Definition: sgproductpolicy.hpp:88
const SGPolicySet & getPolicies(int state) const
Get method for policies in a given state.
Definition: sgproductpolicy.hpp:53
void insertPolicy(int state, const SGPolicy &policy)
Inserts a new policy in the given state.
Definition: sgproductpolicy.hpp:70