DMP_BBO library
Public Member Functions | List of all members
DemoTaskSolverApproximateQuadraticFunction Class Reference

The task solver tunes the parameters a and c such that the function $ y = a*x^2 + c $ best matches a set of target values y_target for a set of input values x. More...

Inheritance diagram for DemoTaskSolverApproximateQuadraticFunction:
Inheritance graph
[legend]
Collaboration diagram for DemoTaskSolverApproximateQuadraticFunction:
Collaboration graph
[legend]

Public Member Functions

 DemoTaskSolverApproximateQuadraticFunction (const VectorXd &inputs)
 
void performRollout (const VectorXd &sample, const VectorXd &task_parameters, MatrixXd &cost_vars) const
 Function to perform a rollout. More...
 
string toString (void) const
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from TaskSolver
void performRollout (const Eigen::VectorXd &sample, Eigen::MatrixXd &cost_vars) const
 Perform a rollout, i.e. More...
 
virtual void performRollout (const Eigen::VectorXd &sample, const Eigen::VectorXd &task_parameters, Eigen::MatrixXd &cost_vars) const =0
 Perform a rollout, i.e. More...
 

Detailed Description

The task solver tunes the parameters a and c such that the function $ y = a*x^2 + c $ best matches a set of target values y_target for a set of input values x.

Definition at line 115 of file demoOptimizationTask.cpp.

Constructor & Destructor Documentation

DemoTaskSolverApproximateQuadraticFunction ( const VectorXd &  inputs)
inline
Parameters
[in]inputsx in $ y = a*x^2 + c $

Definition at line 121 of file demoOptimizationTask.cpp.

122  {
123  inputs_ = inputs;
124  }

Member Function Documentation

void performRollout ( const VectorXd &  sample,
const VectorXd &  task_parameters,
MatrixXd &  cost_vars 
) const
inline

Function to perform a rollout.

Parameters
[in]sampleSample containing variation of a and c (in $ y = a*x^2 + c $)
[in]task_parametersIgnored
[in]cost_varsCost-relevant variables, containing the predictions

Definition at line 131 of file demoOptimizationTask.cpp.

132  {
133 
134  VectorXd predictions;
135  double a = sample(0);
136  double c = sample(1);
137  targetFunction(a,c,inputs_,predictions);
138  cost_vars = predictions;
139  }
void targetFunction(double a, double c, const VectorXd &inputs, VectorXd &outputs)
Target function .

Here is the call graph for this function:

string toString ( void  ) const
inlinevirtual

Returns a string representation of the object.

Returns
A string representation of the object.

Implements TaskSolver.

Definition at line 144 of file demoOptimizationTask.cpp.

145  {
146  string str = "TaskApproximateQuadraticFunctionSolver";
147  return str;
148  }

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