/*! Returns the default properties of a particular input channel */ map<string, Property> InputChannelFactory::getDefaultProperties(Description& desc) { if(desc.getName() == "Joint Input Channel") { return JointInputChannel().getProperties(); } else if(desc.getName() == "Visual Input Channel") { return VisualInputChannel().getProperties(); } throw ISpikeException("Invalid input channel"); }
// This function checks if the problem parameters are correct, then tells // Solver to solve the current problem. void solveProblem(const Description & description, const Parameters & parameters, Preferences & preferences, Solver & solver) { // The problem is ready to be solved if the parameters file contains all // the basic parameters. if (parameters.readyToSolve()) { // The parameters are captured and sent to Solver. parameters.capture(description.getGeneralConstraintsNumber(), description.getSurrogateUse(), solver); // The preferences are sent to Solver. preferences.capture(description.getName(), solver); // Data entry complete: Solver evaluates the starting point. if (solver.evaluateStartingPoint() > 0) { // 'fout' is the results file for the current run. ofstream fout(description.getResultsFile()); // The problem's input is written in 'fout'. solver.showInput(fout); // The problem is solved by the optimization module. solver.solveProblem(fout); // The results file is closed. fout.close(); // The 'Preferences' object must be alerted that the run is over. preferences.endOfRun(); } else { cerr << "The starting point is outside the bounds!\n"; cerr << "Please correct before running NOMAD.\n"; cerr << "See the program documentation in the 'DOC' directory.\n\n"; } } else { // We alert the user that something's wrong with the parameters. cerr << "Something is wrong with the parameters!\n"; cerr << "Please correct before running NOMAD.\n"; cerr << "See the program documentation in the 'DOC' directory.\n\n"; } }