--- trunk/gadget/readmain.cc 2014/02/10 17:09:07 1 +++ trunk/gadget/readmain.cc 2017/04/07 09:20:55 20 @@ -278,7 +278,7 @@ // // A function to read optimisation information // -void Ecosystem::readOptimisation(CommentStream& infile) { +void Ecosystem::readOptimisation(CommentStream& infile, unsigned* seed) { char* text = new char[MaxStrLength]; strncpy(text, "", MaxStrLength); handle.logMessage(LOGMESSAGE, "Reading optimisation information"); @@ -305,11 +305,14 @@ optvec.resize(new OptInfoSimann()); else if (strcasecmp(text, "[bfgs]") == 0) optvec.resize(new OptInfoBFGS()); + else if (strcasecmp(text, "[pso]") == 0) + optvec.resize(new OptInfoPso()); else - handle.logFileUnexpected(LOGFAIL, "[hooke], [simann], or [bfgs]", text); + handle.logFileUnexpected(LOGFAIL, "[hooke], [simann], [bfgs], or [pso]", text); if (!infile.eof()) { infile >> text; + optvec[count]->setSeed(seed); optvec[count]->read(infile, text); } else handle.logMessage(LOGINFO, "Warning - no parameters specified for optimisation algorithm");