OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::TargetSet Class Reference

#include <Target.h>

+ Collaboration diagram for opencog::TargetSet:

Public Member Functions

 TargetSet ()
 
 ~TargetSet ()
 
void clear ()
 
void emplace (Handle h, Handle hvardecl)
 
unsigned int size ()
 
Targetselect ()
 
Targetget (Handle &h)
 

Private Attributes

std::map< Handle, Target_targets_map
 
AtomSpace _history_space
 
unsigned int _total_selection
 

Detailed Description

Definition at line 127 of file Target.h.

Constructor & Destructor Documentation

TargetSet::TargetSet ( )

Constructor.

Definition at line 123 of file Target.cc.

TargetSet::~TargetSet ( )

Destructor.

Definition at line 131 of file Target.cc.

Member Function Documentation

void TargetSet::clear ( )

Clear the TargetSet.

Definition at line 139 of file Target.cc.

References _history_space, _targets_map, and opencog::AtomSpace::clear().

+ Here is the caller graph for this function:

void TargetSet::emplace ( Handle  h,
Handle  hvardecl 
)

Add a new Target into the set.

Parameters
hthe atom to which the Target will be created

Definition at line 150 of file Target.cc.

References _history_space, and _targets_map.

+ Here is the caller graph for this function:

Target & TargetSet::get ( Handle h)

Get a specific Target.

Parameters
hthe handle of the Target
Returns
a reference to the Target

Definition at line 204 of file Target.cc.

References _targets_map.

+ Here is the caller graph for this function:

Target & TargetSet::select ( )

Select a Target from the set using some fitness criteria.

Currently uses the selection count to apply weighted random selection.

XXX TODO use criteria such as

  • how many steps from the initial target
  • how much was gained on this target the last time it was chosen etc
Returns
a reference to the selected Target

Definition at line 178 of file Target.cc.

References _targets_map, _total_selection, opencog::Target::increment_selection_count(), and python.undocumented.blocksworld::t.

+ Here is the caller graph for this function:

unsigned int TargetSet::size ( void  )

Get the size of the TargetSet.

Definition at line 161 of file Target.cc.

References _targets_map.

+ Here is the caller graph for this function:

Member Data Documentation

AtomSpace opencog::TargetSet::_history_space
private

Definition at line 141 of file Target.h.

std::map<Handle, Target> opencog::TargetSet::_targets_map
private

Definition at line 140 of file Target.h.

unsigned int opencog::TargetSet::_total_selection
private

Definition at line 142 of file Target.h.


The documentation for this class was generated from the following files: