PLearn 0.1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Private Member Functions
PLearn::ExplicitListOracle Class Reference

#include <ExplicitListOracle.h>

Inheritance diagram for PLearn::ExplicitListOracle:
Inheritance graph
[legend]
Collaboration diagram for PLearn::ExplicitListOracle:
Collaboration graph
[legend]

List of all members.

Public Types

typedef OptionsOracle inherited

Public Member Functions

 ExplicitListOracle ()
virtual TVec< string > getOptionNames () const
 returns the set of names of options this generator generates
virtual TVec< string > generateNextTrial (const TVec< string > &older_trial, real obtained_objective)
virtual void forget ()
 SUBCLASS WRITING: Should reset the generator's internal state (as having no info about previous trials).
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual ExplicitListOracledeepCopy (CopiesMap &copies) const

Static Public Member Functions

static string _classname_ ()
 Declares name and deepCopy methods.
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Public Attributes

TVec< string > option_names
 name of options
TMat< string > option_values
 A matrix with as many columns as there are options, giving their values.

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares this class' options.

Protected Attributes

int nreturned
 number of trials returned so far (This is also the index of the next trial that will get returned)

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 52 of file ExplicitListOracle.h.


Member Typedef Documentation

Reimplemented from PLearn::OptionsOracle.

Definition at line 65 of file ExplicitListOracle.h.


Constructor & Destructor Documentation

PLearn::ExplicitListOracle::ExplicitListOracle ( )

Definition at line 48 of file ExplicitListOracle.cc.

    :OptionsOracle(),
     nreturned(0)
/* ### Initialise all fields to their default value */
{
    // ...

    // ### You may or may not want to call build_() to finish building the object
    // build_();
}

Member Function Documentation

string PLearn::ExplicitListOracle::_classname_ ( ) [static]

Declares name and deepCopy methods.

Reimplemented from PLearn::OptionsOracle.

Definition at line 59 of file ExplicitListOracle.cc.

OptionList & PLearn::ExplicitListOracle::_getOptionList_ ( ) [static]

Reimplemented from PLearn::OptionsOracle.

Definition at line 59 of file ExplicitListOracle.cc.

RemoteMethodMap & PLearn::ExplicitListOracle::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::OptionsOracle.

Definition at line 59 of file ExplicitListOracle.cc.

bool PLearn::ExplicitListOracle::_isa_ ( const Object o) [static]

Reimplemented from PLearn::OptionsOracle.

Definition at line 59 of file ExplicitListOracle.cc.

Object * PLearn::ExplicitListOracle::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 59 of file ExplicitListOracle.cc.

StaticInitializer ExplicitListOracle::_static_initializer_ & PLearn::ExplicitListOracle::_static_initialize_ ( ) [static]

Reimplemented from PLearn::OptionsOracle.

Definition at line 59 of file ExplicitListOracle.cc.

void PLearn::ExplicitListOracle::build ( ) [virtual]

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::OptionsOracle.

Definition at line 107 of file ExplicitListOracle.cc.

References PLearn::OptionsOracle::build(), and build_().

Here is the call graph for this function:

void PLearn::ExplicitListOracle::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::OptionsOracle.

Definition at line 95 of file ExplicitListOracle.cc.

Referenced by build().

{
    // ### This method should do the real building of the object,
    // ### according to set 'options', in *any* situation.
    // ### Typical situations include:
    // ###  - Initial building of an object from a few user-specified options
    // ###  - Building of a "reloaded" object: i.e. from the complete set of all serialised options.
    // ###  - Updating or "re-building" of an object after a few "tuning" options have been modified.
    // ### You should assume that the parent class' build_() has already been called.
}

Here is the caller graph for this function:

string PLearn::ExplicitListOracle::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 59 of file ExplicitListOracle.cc.

void PLearn::ExplicitListOracle::declareOptions ( OptionList ol) [static, protected]

Declares this class' options.

Reimplemented from PLearn::OptionsOracle.

Definition at line 61 of file ExplicitListOracle.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::OptionsOracle::declareOptions(), PLearn::OptionBase::learntoption, nreturned, option_names, and option_values.

{
    declareOption(ol, "option_names", &ExplicitListOracle::option_names, OptionBase::buildoption,
                  "name of options");

    declareOption(ol, "option_values", &ExplicitListOracle::option_values, OptionBase::buildoption,
                  "A matrix with as many columns as there are options, giving their values");

    declareOption(ol, "nreturned", &ExplicitListOracle::nreturned,
                  OptionBase::learntoption,
                  "The number of returned option");

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

static const PPath& PLearn::ExplicitListOracle::declaringFile ( ) [inline, static]

Reimplemented from PLearn::OptionsOracle.

Definition at line 113 of file ExplicitListOracle.h.

ExplicitListOracle * PLearn::ExplicitListOracle::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::OptionsOracle.

Definition at line 59 of file ExplicitListOracle.cc.

void PLearn::ExplicitListOracle::forget ( ) [virtual]

SUBCLASS WRITING: Should reset the generator's internal state (as having no info about previous trials).

Implements PLearn::OptionsOracle.

Definition at line 88 of file ExplicitListOracle.cc.

References nreturned.

{
    nreturned = 0;
}
TVec< string > PLearn::ExplicitListOracle::generateNextTrial ( const TVec< string > &  older_trial,
real  obtained_objective 
) [virtual]

SUBCLASS WRITING: This notifies the oracle, of the result obtained for a previous trial it suggested. The oracle is expected to return the next suggestion, or an empty vector if stopping conditions were met, or it run out of suggestions. An empty vector may be passed for older_trial if there is no result to report.

Implements PLearn::OptionsOracle.

Definition at line 80 of file ExplicitListOracle.cc.

References PLearn::TMat< T >::length(), nreturned, and option_values.

{
    if(nreturned < option_values.length())
        return option_values(nreturned++);
    else
        return TVec<string>();
}

Here is the call graph for this function:

OptionList & PLearn::ExplicitListOracle::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 59 of file ExplicitListOracle.cc.

OptionMap & PLearn::ExplicitListOracle::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 59 of file ExplicitListOracle.cc.

TVec< string > PLearn::ExplicitListOracle::getOptionNames ( ) const [virtual]

returns the set of names of options this generator generates

Implements PLearn::OptionsOracle.

Definition at line 77 of file ExplicitListOracle.cc.

References option_names.

{ return option_names; }
RemoteMethodMap & PLearn::ExplicitListOracle::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 59 of file ExplicitListOracle.cc.

void PLearn::ExplicitListOracle::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::OptionsOracle.

Definition at line 114 of file ExplicitListOracle.cc.

References PLearn::deepCopyField(), PLearn::OptionsOracle::makeDeepCopyFromShallowCopy(), option_names, and option_values.

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::OptionsOracle.

Definition at line 113 of file ExplicitListOracle.h.

number of trials returned so far (This is also the index of the next trial that will get returned)

Definition at line 61 of file ExplicitListOracle.h.

Referenced by declareOptions(), forget(), and generateNextTrial().

name of options

Definition at line 71 of file ExplicitListOracle.h.

Referenced by declareOptions(), getOptionNames(), and makeDeepCopyFromShallowCopy().

A matrix with as many columns as there are options, giving their values.

Definition at line 72 of file ExplicitListOracle.h.

Referenced by declareOptions(), generateNextTrial(), and makeDeepCopyFromShallowCopy().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines