--- trunk/gadget/ecosystem.h 2014/02/10 17:09:07 1 +++ trunk/gadget/ecosystem.h 2017/04/07 09:20:55 20 @@ -39,6 +39,11 @@ */ Ecosystem(const MainInfo& main); /** + * \brief This is the Ecosystem constructor specifying details about the model + * \param main is the MainInfo specifying the command line options for the model run + */ + Ecosystem(const Ecosystem& ecosystem); + /** * \brief This is the default Ecosystem destructor */ ~Ecosystem(); @@ -82,7 +87,7 @@ * \brief This function will read in the optimisation parameters from the input file * \param infile is the CommentStream to read the optimisation parameters from */ - void readOptimisation(CommentStream& infile); + void readOptimisation(CommentStream& infile, unsigned* seed); /** * \brief This function will write the current model status to file * \param filename is the name of the file to write the model information to @@ -124,6 +129,13 @@ * \param Stochastic is the StochasticData containing the new values of the parameters */ void Update(const StochasticData* const Stochastic) const { keeper->Update(Stochastic); }; +#ifdef _OPENMP + /** + * \brief This function will update the store values of the parameters of the Ecosystems used with OpenMP + * \param v is the DoubleVector that store the values of the parameters of the main Ecosystem + */ + void Update(const DoubleVector v)const { keeper->Update(v);} +#endif /** * \brief This function will reset the Ecosystem information */ @@ -258,9 +270,14 @@ */ StockPtrVector& getModelStockVector() { return stockvec; }; /** + * \brief This function will return the DoubleVector used to store the values of the parameters + * \return values the return of the method getValues from Keeper + */ + DoubleVector getValues() {return keeper->getValues();} + /** * \brief This is the flag used to denote whether the user has interrupted the current model run */ - volatile int interrupted; + //volatile int interrupted; protected: /** * \brief This is the value of the likelihood score for the current simulation @@ -337,6 +354,18 @@ * \note This vector is only used to temporarily store values during an optimising run */ IntVector optflag; +#ifdef _OPENMP + /** + * \brief This empty char is used for the purpose of avoiding false sharing between the EcoSystems. + */ + char filling[128]; + /** + * \brief Type of selected parallel optimization + */ + const int static SPECULATIVE=1; + const int static REPRODUCIBLE=2; + int runParallel; +#endif }; #endif