MultiAgentDecisionProcess
Scope Class Reference

#include <Scope.h>

Inheritance diagram for Scope:
[legend]

Public Member Functions

bool Contains (Index i) const
 Whether this contains Index i. More...
 
bool Equals (const Scope &s) const
 Whether two scopes are equal (i.e., with same ordering) More...
 
SDT::iterator GetIteratorForIndex (Index i)
 Returns iterator to index i in this (or end() if i not contained) More...
 
Index GetPositionForIndex (Index i) const
 Returns the position of index i within this. More...
 
void Insert (Index i)
 Insert an index into the scope. More...
 
void Insert (const Scope &s)
 Merges all indices in s into this. More...
 
ScopeInstance Instantiate (const std::vector< Index > &values) const
 
bool IsSubSetOf (const Scope &s) const
 Whether this is a subset of s. More...
 
Scopeoperator= (const Scope &o)
 
Scopeoperator= (const SDT &o)
 
void Remove (const Scope &s)
 Removes all indices in s from this. More...
 
 Scope ()
 Default constructor. More...
 
 Scope (const SDT &o)
 
template<typename InputIterator >
 Scope (InputIterator first, InputIterator last, const allocator_type &a=allocator_type())
 
 Scope (const std::string &s)
 
 Scope (size_t size)
 
std::string SoftPrint () const
 
ScopeSort ()
 Sorts the indices. More...
 
ScopeSortAndUnique ()
 First calls Sort() and then removes duplicate indices. More...
 

Static Public Member Functions

static Scope Intersection (const Scope &a, const Scope &b)
 Returns a scope containing the intersection of a and b. More...
 
static void Sort (Scope &scope, ScopeInstance &scopeInstance)
 Sorts the indices of the scope and applies the same reordering to the scope instance. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const Scope &s)
 
std::istream & operator>> (std::istream &i, Scope &s)
 

Constructor & Destructor Documentation

Scope::Scope ( )
inline

Default constructor.

Scope::Scope ( const SDT &  o)
inline
template<typename InputIterator >
Scope::Scope ( InputIterator  first,
InputIterator  last,
const allocator_type &  a = allocator_type() 
)
inline
Scope::Scope ( const std::string &  s)
Scope::Scope ( size_t  size)
inline

Member Function Documentation

bool Scope::Equals ( const Scope s) const

Whether two scopes are equal (i.e., with same ordering)

References ArgumentHandlers::size().

Referenced by BayesianGameCollaborativeGraphical::AddLRF().

SDT::iterator Scope::GetIteratorForIndex ( Index  i)

Returns iterator to index i in this (or end() if i not contained)

void Scope::Insert ( Index  i)
inline

Insert an index into the scope.

Note this does not check for duplicates!

Referenced by MultiAgentDecisionProcess::AddAgent(), MADPComponentFactoredStates::AddStateFactor(), TwoStageDynamicBayesianNetwork::ComputeWithinNextStageClosure(), FSAOHDist_NECOF::FSAOHDist_NECOF(), ProblemFireFightingGraph::GetHousesAgentInfluences(), ProblemFOBSFireFightingGraph::GetHousesAgentInfluences(), ProblemFOBSFireFightingFactored::GetHousesAgentInfluences(), ProblemFireFightingFactored::GetHousesAgentInfluences(), FSAOHDist_NECOF::GetXOHProb_relT(), MultiAgentDecisionProcessDiscreteFactoredStates::Initialize2DBN(), ProblemAloha::InitializeAloha(), ProblemFOBSFireFightingFactored::InitializePFFF(), ProblemFireFightingFactored::InitializePFFF(), Instantiate(), Intersection(), MultiAgentDecisionProcessDiscreteFactoredStates::MarginalizeTransitionObservationModel(), MultiAgentDecisionProcess::MultiAgentDecisionProcess(), operator>>(), Problem_CGBG_FF::Problem_CGBG_FF(), BayesianGameCollaborativeGraphical::RecurseOverAgents(), MultiAgentDecisionProcessDiscreteFactoredStates::RemoveStateFactor(), TwoStageDynamicBayesianNetwork::ScopeBackup(), MultiAgentDecisionProcess::SetNrAgents(), ProblemFireFightingGraph::SetOScopes(), ProblemAloha::SetOScopes(), ProblemFireFightingFactored::SetOScopes(), FactoredDecPOMDPDiscrete::SetScopeForLRF(), ProblemFireFightingGraph::SetYScopes(), ProblemFOBSFireFightingGraph::SetYScopes(), ProblemAloha::SetYScopes(), ProblemFOBSFireFightingFactored::SetYScopes(), and ProblemFireFightingFactored::SetYScopes().

void Scope::Insert ( const Scope s)

Merges all indices in s into this.

ScopeInstance Scope::Instantiate ( const std::vector< Index > &  values) const

References Insert().

Scope Scope::Intersection ( const Scope a,
const Scope b 
)
static

Returns a scope containing the intersection of a and b.

References Contains(), and Insert().

Referenced by TreeIncPruneBGPlanner::ComputeKey().

bool Scope::IsSubSetOf ( const Scope s) const

Whether this is a subset of s.

References ArgumentHandlers::size().

Referenced by MultiAgentDecisionProcessDiscreteFactoredStates::Initialize2DBN().

Scope& Scope::operator= ( const Scope o)
inline
Scope& Scope::operator= ( const SDT &  o)
inline
void Scope::Sort ( Scope scope,
ScopeInstance scopeInstance 
)
static

Sorts the indices of the scope and applies the same reordering to the scope instance.

References apply_permutation(), and sort_permutation().

Scope & Scope::SortAndUnique ( )

First calls Sort() and then removes duplicate indices.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const Scope s 
)
friend
std::istream& operator>> ( std::istream &  i,
Scope s 
)
friend