CARLsim
6.1.0
CARLsim: a GPU-accelerated SNN simulator
|
#include <PTI.h>
Classes | |
struct | PTIImpl |
Public Member Functions | |
PTI (const int argc, const char *const argv[], ostream &outputStream) | |
PTI (const int argc, const char *const argv[], ostream &outputStream, istream &defaultInputStream) | |
~PTI () | |
bool | repOK () const |
void | runExperiment (const Experiment &experiment) const |
string | usage () const |
The CARLsim parameter-tuning interface (PTI) provides a standardized interface for tuning a model with an external optimization tool.
The PTI class reads a list of real-valued parameter vectors from a file or istream and passes them to an Experiment object to have their performance evaluated. You should implement a subclass of Experiment that executes your model and calculates some kind of information about its behavior, which PTI will write to an ostream.
The intent is that PTI and an Experiment can be used in the main method of a simple program:
A program like this can serve as the interface between CARLsim an an optimization tool (such as the ECJ metaheuristics toolkit).
PTI | ( | const int | argc, |
const char *const | argv[], | ||
ostream & | outputStream | ||
) |
Parse command-line arguments and set up a PTI instance that writes fitnesses or phenotypes to the specified ostream.
If a file is specified in the arguments via the option '-f filename', then parameter vectors are read from the file. Otherwise, the are read from std::cin.
argc | The number of command-line arguments |
argv | Array of command-line argument |
outputStream | An ostream to write fitness or phenotype values to |
Definition at line 72 of file PTI.cpp.
PTI | ( | const int | argc, |
const char *const | argv[], | ||
ostream & | outputStream, | ||
istream & | defaultInputStream | ||
) |
Parse command-line arguments and set up a PTI instance that writes fitnesses or phenotypes to the specified ostream.
If a file is specified in the arguments via the option '-f filename', then parameter vectors are read from the file. Otherwise, they are read from the specified default istream.
argc | The number of command-line arguments |
argv | Array of command-line argument |
outputStream | An ostream to write fitness or phenotype values to |
defaultInputStream | An istream to receive parameter vectors from if no file is specified. |
Definition at line 78 of file PTI.cpp.
bool repOK | ( | ) | const |
void runExperiment | ( | const Experiment & | experiment | ) | const |
Execute an Experiment on the incoming parameter vectors, telling it to write results to the outgoing ostream.
experiment | The Experiment whose Experiment::run() method should be executed. |
Definition at line 97 of file PTI.cpp.
string usage | ( | ) | const |