Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Diff of /trunk/gadget/optinfosimann.cc
[mareframe] / trunk / gadget / optinfosimann.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/optinfosimann.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10, Wed Jun 10 13:01:42 2015 UTC revision 11, Thu Jul 23 19:00:38 2015 UTC
# Line 13  Line 13 
13  void OptInfoSimann::read(CommentStream& infile, char* text) {  void OptInfoSimann::read(CommentStream& infile, char* text) {
14    handle.logMessage(LOGMESSAGE, "Reading Simulated Annealing optimisation parameters");    handle.logMessage(LOGMESSAGE, "Reading Simulated Annealing optimisation parameters");
15    
16      unsigned s1 = 0;
17      unsigned s2 = 0;
18      unsigned s3 = 0;
19    
20    int count = 0;    int count = 0;
21    while (!infile.eof() && strcasecmp(text, "[simann]") && strcasecmp(text, "[hooke]") && strcasecmp(text, "[bfgs]")) {    while (!infile.eof() && strcasecmp(text, "[simann]") && strcasecmp(text, "[hooke]") && strcasecmp(text, "[bfgs]")) {
22      infile >> ws;      infile >> ws;
23      if (strcasecmp(text, "seed") == 0) {      if (strcasecmp(text, "seed") == 0) {
24        int seed = 0;        int s = 0;
25        infile >> seed >> ws;        infile >> s >> ws;
26        handle.logMessage(LOGMESSAGE, "Initialising random number generator with", seed);        s1 = s;
27        srand(seed);        handle.logMessage(LOGMESSAGE, "Initialising random number generator with", s);
28          srand(s1);
29    //fixme doc
30            } if (strcasecmp(text, "seedM") == 0) {
31              int s = 0;
32              infile >> s >> ws;
33              s2 = s;
34              handle.logMessage(LOGMESSAGE, "Initialising random number generator with", s);
35    
36            } if (strcasecmp(text, "seedP") == 0) {
37              int s = 0;
38          infile >> s >> ws;
39              s3 = s;
40              handle.logMessage(LOGMESSAGE, "Initialising random number generator with", s);
41    
42      } else if (strcasecmp(text, "simanniter") == 0) {      } else if (strcasecmp(text, "simanniter") == 0) {
43        infile >> simanniter;        infile >> simanniter;
# Line 77  Line 94 
94      infile >> text;      infile >> text;
95    }    }
96    
97      if (s1 != 0) {
98              seed = s1;
99              if (s2 == 0)
100                      seedM = s1;
101              else seedM = s2;
102              if (s3 == 0)
103                      seedP = s1;
104              else seedP = s3;
105      } else {
106              if (s2 != 0)
107                      seedP = s2;
108              if (s3 != 0)
109                      seedP = s3;
110      }
111    
112    if (count == 0)    if (count == 0)
113      handle.logMessage(LOGINFO, "Warning - no parameters specified for Simulated Annealing optimisation algorithm");      handle.logMessage(LOGINFO, "Warning - no parameters specified for Simulated Annealing optimisation algorithm");
114    

Legend:
Removed from v.10  
changed lines
  Added in v.11

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge