iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::learningmachine::PredictModule Class Reference

A module for predictions. More...

#include <PredictModule.h>

+ Inheritance diagram for iCub::learningmachine::PredictModule:

Public Member Functions

 PredictModule (std::string pp="/lm/predict")
 Constructor. More...
 
virtual ~PredictModule ()
 Destructor (empty). More...
 
virtual bool configure (yarp::os::ResourceFinder &opt)
 
virtual bool interruptModule ()
 
virtual bool respond (const yarp::os::Bottle &cmd, yarp::os::Bottle &reply)
 
virtual bool close ()
 Close the module. More...
 
virtual IMachineLearnergetMachine ()
 Retrieve the machine that is wrapped in the portable machine wrapper. More...
 
virtual MachinePortablegetMachinePortable ()
 Retrieve the machine portable. More...
 
- Public Member Functions inherited from iCub::learningmachine::IMachineLearnerModule
 IMachineLearnerModule (std::string pp)
 Constructor. More...
 
virtual ~IMachineLearnerModule ()
 Destructor (empty). More...
 
virtual bool updateModule ()
 Default empty update loop with 1 second delay. More...
 

Protected Member Functions

 PredictModule (const PredictModule &other)
 Copy constructor (private and unimplemented on purpose). More...
 
PredictModuleoperator= (const PredictModule &other)
 Assignment operator (private and unimplemented on purpose). More...
 
void registerAllPorts ()
 Registers all ports used by this module. More...
 
void unregisterAllPorts ()
 Unregisters all ports used by this module. More...
 
void printOptions (std::string error="")
 Prints the accepted command line options with an optional error message. More...
 
- Protected Member Functions inherited from iCub::learningmachine::IMachineLearnerModule
 IMachineLearnerModule (const IMachineLearnerModule &other)
 Copy Constructor (private and unimplemented on purpose). More...
 
IMachineLearnerModuleoperator= (const IMachineLearnerModule &other)
 Assignment operator (private and unimplemented on purpose). More...
 
void registerPort (yarp::os::Contactable &port, std::string name)
 Register a port with a given name. More...
 
virtual void loadCommandFile (std::string fname, yarp::os::Bottle *out=(yarp::os::Bottle *) 0)
 Reads bottles from a file and sends these one by one to the respond method. More...
 
virtual yarp::os::ResourceFinder & getResourceFinder ()
 Returns a reference to the cached ResourceFinder. More...
 
std::string findFile (std::string fname)
 Finds the full path to a specified filename using the ResourceFinder. More...
 
virtual void setResourceFinder (yarp::os::ResourceFinder *rf)
 Mutator for the locally stored ResourceFinder. More...
 

Protected Attributes

yarp::os::BufferedPort< yarp::sig::Vector > predict_inout
 Buffered port for the incoming samples and corresponding replies. More...
 
MachinePortable machinePortable
 A concrete wrapper around a learning machine. More...
 
PredictProcessor predictProcessor
 The processor handling prediction requests. More...
 
yarp::os::Port model_in
 Incoming port for the models from the train module. More...
 
- Protected Attributes inherited from iCub::learningmachine::IMachineLearnerModule
yarp::os::Port cmd_in
 An input port for commands. More...
 
std::string portPrefix
 A prefix path for the ports that will be registered. More...
 
DispatcherManager dmanager
 An instance of the DispatchManager to configure event listeners. More...
 
yarp::os::ResourceFinder * rf
 A pointer to the ResourceFinder. More...
 

Detailed Description

A module for predictions.

The module can contain any iCub::learningmachine::IMachineLearner. This module can be used in a combined system with a TrainModule.

See also
iCub::learningmachine::IMachineLearner
iCub::learningmachine::IMachineLearnerModule
iCub::learningmachine::TrainModule
Author
Arjan Gijsberts, Francesco Orabona, Paul Fitzpatrick

Definition at line 113 of file PredictModule.h.

Constructor & Destructor Documentation

◆ PredictModule() [1/2]

iCub::learningmachine::PredictModule::PredictModule ( const PredictModule other)
protected

Copy constructor (private and unimplemented on purpose).

◆ PredictModule() [2/2]

iCub::learningmachine::PredictModule::PredictModule ( std::string  pp = "/lm/predict")
inline

Constructor.

Parameters
ppthe default prefix used for the ports.

Definition at line 167 of file PredictModule.h.

◆ ~PredictModule()

virtual iCub::learningmachine::PredictModule::~PredictModule ( )
inlinevirtual

Destructor (empty).

Definition at line 174 of file PredictModule.h.

Member Function Documentation

◆ close()

virtual bool iCub::learningmachine::PredictModule::close ( void  )
inlinevirtual

Close the module.

Returns
true if the module was closed successfully

Reimplemented from iCub::learningmachine::IMachineLearnerModule.

Definition at line 194 of file PredictModule.h.

◆ configure()

bool iCub::learningmachine::PredictModule::configure ( yarp::os::ResourceFinder &  opt)
virtual

Reimplemented in iCub::learningmachine::TrainModule.

Definition at line 99 of file PredictModule.cpp.

◆ getMachine()

virtual IMachineLearner& iCub::learningmachine::PredictModule::getMachine ( )
inlinevirtual

Retrieve the machine that is wrapped in the portable machine wrapper.

Returns
a reference to the actual machine

Definition at line 208 of file PredictModule.h.

◆ getMachinePortable()

virtual MachinePortable& iCub::learningmachine::PredictModule::getMachinePortable ( )
inlinevirtual

Retrieve the machine portable.

Returns
a reference to the machine portable

Definition at line 217 of file PredictModule.h.

◆ interruptModule()

bool iCub::learningmachine::PredictModule::interruptModule ( )
virtual

Reimplemented in iCub::learningmachine::TrainModule.

Definition at line 92 of file PredictModule.cpp.

◆ operator=()

PredictModule& iCub::learningmachine::PredictModule::operator= ( const PredictModule other)
protected

Assignment operator (private and unimplemented on purpose).

◆ printOptions()

void iCub::learningmachine::PredictModule::printOptions ( std::string  error = "")
protectedvirtual

Prints the accepted command line options with an optional error message.

Implements iCub::learningmachine::IMachineLearnerModule.

Definition at line 67 of file PredictModule.cpp.

◆ registerAllPorts()

void iCub::learningmachine::PredictModule::registerAllPorts ( )
protectedvirtual

Registers all ports used by this module.

Implements iCub::learningmachine::IMachineLearnerModule.

Definition at line 79 of file PredictModule.cpp.

◆ respond()

bool iCub::learningmachine::PredictModule::respond ( const yarp::os::Bottle &  cmd,
yarp::os::Bottle &  reply 
)
virtual

Reimplemented in iCub::learningmachine::TrainModule.

Definition at line 151 of file PredictModule.cpp.

◆ unregisterAllPorts()

void iCub::learningmachine::PredictModule::unregisterAllPorts ( )
protectedvirtual

Unregisters all ports used by this module.

Implements iCub::learningmachine::IMachineLearnerModule.

Definition at line 86 of file PredictModule.cpp.

Member Data Documentation

◆ machinePortable

MachinePortable iCub::learningmachine::PredictModule::machinePortable
protected

A concrete wrapper around a learning machine.

Definition at line 124 of file PredictModule.h.

◆ model_in

yarp::os::Port iCub::learningmachine::PredictModule::model_in
protected

Incoming port for the models from the train module.

Definition at line 134 of file PredictModule.h.

◆ predict_inout

yarp::os::BufferedPort<yarp::sig::Vector> iCub::learningmachine::PredictModule::predict_inout
protected

Buffered port for the incoming samples and corresponding replies.

Definition at line 119 of file PredictModule.h.

◆ predictProcessor

PredictProcessor iCub::learningmachine::PredictModule::predictProcessor
protected

The processor handling prediction requests.

Definition at line 129 of file PredictModule.h.


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