[Avida-SVN] r1746 - branches/vo/source/targets/avida

michaelvo at myxo.css.msu.edu michaelvo at myxo.css.msu.edu
Tue Jul 3 10:56:16 PDT 2007


Author: michaelvo
Date: 2007-07-03 13:56:16 -0400 (Tue, 03 Jul 2007)
New Revision: 1746

Added:
   branches/vo/source/targets/avida/cConsoleRunDriver.cc
   branches/vo/source/targets/avida/cConsoleRunDriver.h
Log:
Add new files to the branch.

Added: branches/vo/source/targets/avida/cConsoleRunDriver.cc
===================================================================
--- branches/vo/source/targets/avida/cConsoleRunDriver.cc	                        (rev 0)
+++ branches/vo/source/targets/avida/cConsoleRunDriver.cc	2007-07-03 17:56:16 UTC (rev 1746)
@@ -0,0 +1,57 @@
+/*
+ *  cConsoleRunDriver.h
+ *  Avida
+ *
+ *  Created by Michael on 6/29/07
+ *  Copyright 1999-2007 Michigan State University. All rights reserved.
+ *
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; version 2
+ *  of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ */
+
+#include "cConsoleRunDriver.h"
+
+#include "cDefaultRunDriver.h"
+#include "cPopulation.h"
+#include "cStats.h"
+
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+cConsoleRunDriver::cConsoleRunDriver(cWorld* world) :  cDefaultRunDriver(world) {}
+
+void cConsoleRunDriver::UpdateView()
+{
+  cPopulation& population = m_world->GetPopulation();
+  cStats& stats = m_world->GetStats();
+  
+  
+  // No viewer; print out status for this update....
+  if (m_world->GetVerbosity() > VERBOSE_SILENT) {
+    cout.setf(ios::left);
+    cout.setf(ios::showpoint);
+    cout << "UD: " << setw(6) << stats.GetUpdate() << "  "
+      << "Gen: " << setw(9) << setprecision(7) << stats.SumGeneration().Average() << "  "
+      << "Fit: " << setw(9) << setprecision(7) << stats.GetAveFitness() << "  "
+      //  << "Energy: " << setw(9) << setprecision(7) << stats.GetAveEnergy() << "  "
+      //        << "Merit: " << setw(9) << setprecision(7) << stats.GetAveMerit() << "  "
+      << "Orgs: " << setw(6) << population.GetNumOrganisms() << "  "
+      << "Thrd: " << setw(6) << stats.GetNumThreads() << "  "
+      << "Para: " << stats.GetNumParasites()
+      << endl;
+  }
+}  
+

Added: branches/vo/source/targets/avida/cConsoleRunDriver.h
===================================================================
--- branches/vo/source/targets/avida/cConsoleRunDriver.h	                        (rev 0)
+++ branches/vo/source/targets/avida/cConsoleRunDriver.h	2007-07-03 17:56:16 UTC (rev 1746)
@@ -0,0 +1,41 @@
+/*
+ *  cConsoleRunDriver.h
+ *  Avida
+ *
+ *  Created by Michael on 6/29/07
+ *  Copyright 1999-2007 Michigan State University. All rights reserved.
+ *
+ *
+ *  This program is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License
+ *  as published by the Free Software Foundation; version 2
+ *  of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ */
+
+#ifndef cConsoleRunDriver_h
+#define cConsoleRunDriver_h
+
+#ifndef cDefaultRunDriver_h
+#include "cDefaultRunDriver.h"
+#endif
+
+
+class cConsoleRunDriver : public cDefaultRunDriver
+{
+public:
+  cConsoleRunDriver(cWorld* world);
+  
+  void UpdateView();
+};
+
+#endif




More information about the Avida-cvs mailing list