[Avida-SVN] r1747 - in development: . source source/targets source/targets/avida-viewer source/targets/viewer-text source/viewer-core

ofria at myxo.css.msu.edu ofria at myxo.css.msu.edu
Tue Jul 3 11:05:02 PDT 2007


Author: ofria
Date: 2007-07-03 14:05:02 -0400 (Tue, 03 Jul 2007)
New Revision: 1747

Added:
   development/source/targets/viewer-text/
   development/source/targets/viewer-text/LAYOUT
   development/source/targets/viewer-text/cDriver_TextViewer.cc
   development/source/targets/viewer-text/cDriver_TextViewer.h
   development/source/targets/viewer-text/cTextViewerManager.cc
   development/source/targets/viewer-text/cTextViewerManager.h
   development/source/targets/viewer-text/viewer-text.cc
   development/source/viewer-core/
   development/source/viewer-core/LAYOUT
   development/source/viewer-core/cCoreView_Info.cc
   development/source/viewer-core/cCoreView_Info.h
Removed:
   development/source/targets/viewer-core/
Modified:
   development/CMakeLists.txt
   development/source/targets/avida-viewer/cTextWindow.cc
Log:
Added in some of the framework for the new core viewer and the new text viewer that will use it.
None of this is working yet, but it does not affect the working parts of Avida.


Modified: development/CMakeLists.txt
===================================================================
--- development/CMakeLists.txt	2007-07-03 17:56:16 UTC (rev 1746)
+++ development/CMakeLists.txt	2007-07-03 18:05:02 UTC (rev 1747)
@@ -141,6 +141,16 @@
 LIST(APPEND ALL_INC_DIRS ${CLASSIFICATION_DIR})
 
 
+# The core viewer directory
+SET(COREVIEW_DIR ${PROJECT_SOURCE_DIR}/source/viewer-core)
+SET(COREVIEW_SOURCES
+  ${COREVIEW_DIR}/cCoreView_Info.cc
+)
+SOURCE_GROUP(coreview FILES ${COREVIEW_SOURCES})
+LIST(APPEND AVIDA_CORE_SOURCES ${COREVIEW_SOURCES})
+LIST(APPEND ALL_INC_DIRS ${COREVIEW_DIR})
+
+
 # The cpu directory
 SET(CPU_DIR ${PROJECT_SOURCE_DIR}/source/cpu)
 SET(CPU_SOURCES
@@ -320,7 +330,7 @@
 ENDIF(AVD_CMDLINE)
 
 
-# By default, build the console interface to Avida.
+# By default, do not build the console interface to Avida.
 OPTION(AVD_GUI_NCURSES
   "Enable building Avida console interface."
   OFF
@@ -382,6 +392,116 @@
 ENDIF(AVD_GUI_NCURSES)
 
 
+
+# By default, do not build the console interface to Avida.
+OPTION(AVD_GUI_PROTO_TEXT
+  "Enable building new Avida text interface."
+  OFF
+)
+# Make sure requisites are present for build of console interface.  Give
+# user feedback if they're missing.
+IF(AVD_GUI_PROTO_TEXT)
+  # Locate the ncurses screen handling package (for Avida's console
+  # interface) and the Qt graphics API (for Avida's graphic interface).
+  INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FindNcurses.cmake)
+  IF(NOT NCURSES_INCLUDE_PATH)
+    MESSAGE("Unable to locate header files for the ncurses CRT screen handling package.  Please set the advanced variable NCURSES_INCLUDE_PATH to their location.")
+  ENDIF(NOT NCURSES_INCLUDE_PATH)
+  IF(NOT NCURSES_LIBRARY)
+    MESSAGE("Unable to locate 'libncurses'.  Please set the advanced variable NCURSES_LIBRARY to its location.")
+  ENDIF(NOT NCURSES_LIBRARY)
+
+  IF(NCURSES_LIBRARY AND NCURSES_INCLUDE_PATH)
+
+    INCLUDE_DIRECTORIES(${NCURSES_INCLUDE_PATH})
+    
+    SET(AVIDA_TEXT_VIEWER_DIR source/targets/viewer-text)
+    SET(AVIDA_TEXT_VIEWER_SOURCES
+#      ${AVIDA_TEXT_VIEWER_DIR}/cAnalyzeScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cAnalyzeView.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cBarScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cEnvironmentScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cHistScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cMapScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cMenuWindow.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cOptionsScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cStatsScreen.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cSymbolUtil.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cTextWindow.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cView.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cViewInfo.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cZoomScreen.cc
+      ${AVIDA_TEXT_VIEWER_DIR}/cDriver_TextViewer.cc
+#      ${AVIDA_TEXT_VIEWER_DIR}/cTextViewerManager.cc
+      ${AVIDA_TEXT_VIEWER_DIR}/viewer-text.cc
+    )
+    SOURCE_GROUP(targets\\viewer-text FILES ${AVIDA_TEXT_VIEWER_SOURCES})
+    ADD_EXECUTABLE(avida-textview ${AVIDA_TEXT_VIEWER_SOURCES})
+    
+    SET(AVIDA_TEXT_VIEWER_LIBS avidacore ${NCURSES_LIBRARY})
+    IF(NOT MSVC)
+      LIST(APPEND AVIDA_TEXT_VIEWER_LIBS pthread)
+    ENDIF(NOT MSVC)
+    IF(AVD_ENABLE_TCMALLOC)
+      LIST(APPEND AVIDA_TEXT_VIEWER_LIBS tcmalloc)
+    ENDIF(AVD_ENABLE_TCMALLOC)
+    TARGET_LINK_LIBRARIES(avida-textview ${AVIDA_TEXT_VIEWER_LIBS})
+    
+    INSTALL_TARGETS(/work avida-textview)
+
+  ENDIF(NCURSES_LIBRARY AND NCURSES_INCLUDE_PATH)
+ENDIF(AVD_GUI_PROTO_TEXT)
+
+
+
+# By default, do not build the console interface to Avida.
+OPTION(AVD_GUI_PROTO_FLTK
+  "Enable building new Avida FLTK graphical interface."
+  OFF
+)
+# Make sure requisites are present for build of console interface.  Give
+# user feedback if they're missing.
+IF(AVD_GUI_PROTO_FLTK)
+  # Locate the fltk GUI package 
+  INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FindFLTK.cmake)
+  IF(NOT FLTK_INCLUDE_PATH)
+    MESSAGE("Unable to locate header files for the FLTK graphics package.  Please set the advanced variable FLTK_INCLUDE_PATH to their location.")
+  ENDIF(NOT FLTK_INCLUDE_PATH)
+  IF(NOT FLTK_BASE_LIBRARY)
+    MESSAGE("Unable to locate 'fltk.lib'.  Please set the advanced variable FLTK_BASE_LIBRARY to its location.")
+  ENDIF(NOT FLTK_BASE_LIBRARY)
+
+  IF(FLTK_BASE_LIBRARY AND FLTK_INCLUDE_PATH)
+
+    INCLUDE_DIRECTORIES(${FLTK_INCLUDE_PATH})
+    
+    SET(AVIDA_FLTK_VIEWER_DIR source/targets/viewer-fltk)
+    SET(AVIDA_FLTK_VIEWER_SOURCES
+#      ${AVIDA_FLTK_VIEWER_DIR}/cFltkViewerAnalyzeDriver.cc
+#      ${AVIDA_FLTK_VIEWER_DIR}/cFltkViewerDriver.cc
+#      ${AVIDA_FLTK_VIEWER_DIR}/cFltkViewerDriver_Base.cc
+      ${AVIDA_FLTK_VIEWER_DIR}/viewer-fltk.cc
+    )
+    SOURCE_GROUP(targets\\viewer-fltk FILES ${AVIDA_FLTK_VIEWER_SOURCES})
+    ADD_EXECUTABLE(avida-fltkview ${AVIDA_FLTK_VIEWER_SOURCES})
+    
+    SET(AVIDA_FLTK_VIEWER_LIBS avidacore ${FLTK_BASE_LIBRARY})
+    IF(NOT MSVC)
+      LIST(APPEND AVIDA_FLTK_VIEWER_LIBS pthread)
+    ENDIF(NOT MSVC)
+    IF(AVD_ENABLE_TCMALLOC)
+      LIST(APPEND AVIDA_FLTK_VIEWER_LIBS tcmalloc)
+    ENDIF(AVD_ENABLE_TCMALLOC)
+    TARGET_LINK_LIBRARIES(avida-fltkview ${AVIDA_FLTK_VIEWER_LIBS})
+    
+    INSTALL_TARGETS(/work avida-fltkview)
+
+  ENDIF(FLTK_BASE_LIBRARY AND FLTK_INCLUDE_PATH)
+ENDIF(AVD_GUI_PROTO_FLTK)
+
+
+
 OPTION(AVD_TASK_EVENT_GEN
   "Enable building the task_event_gen utility"
   OFF

Modified: development/source/targets/avida-viewer/cTextWindow.cc
===================================================================
--- development/source/targets/avida-viewer/cTextWindow.cc	2007-07-03 17:56:16 UTC (rev 1746)
+++ development/source/targets/avida-viewer/cTextWindow.cc	2007-07-03 18:05:02 UTC (rev 1747)
@@ -126,9 +126,9 @@
 
 void EndProg(int ignore)
 {
-  signal(SIGINT, SIG_IGN);          // Ignore all future interupts.
-  mvcur(0, COLS - 1, LINES -1, 0);  // Move curser to the lower left.
-  endwin();                         // Restore terminal mode.
+  signal(SIGINT, SIG_IGN);           // Ignore all future interupts.
+  mvcur(0, COLS - 1, LINES - 1, 0);  // Move curser to the lower left.
+  endwin();                          // Restore terminal mode.
 
   printf ("Exit Code: %d\n", ignore);
 

Added: development/source/targets/viewer-text/LAYOUT
===================================================================
--- development/source/targets/viewer-text/LAYOUT	                        (rev 0)
+++ development/source/targets/viewer-text/LAYOUT	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,30 @@
+FROM CORE VIEWER
+
+= Controllers =
+cCoreView_Info : contains all of the basic information that is shared among the view modes, and info about the 
+	current viewer hooked up to Avida.
+
+	- Which view modes are actively associated with this information?
+	- Which population are they hooked up to?
+	- What is the world shape and size?
+	- How many distinct colors does the viewer have to work with?
+	- What pause level are we at?
+
+cCoreView_Base : A generic base class for all of the view modes.
+
+= Modes =
+cCoreView_Analyze     : Manages analyze mode
+cCoreView_Config      : Handles the interface to the configuration files.
+cCoreView_Environment : Manages all of the information about the environment for the current population.
+cCoreView_Hist        : Maintains histograms about various stats for the current population.
+cCoreView_Map         : Manages all of the information for a single map screen.
+cCoreView_Stats       : Deals with the interface to the cStats object with info about the current population.
+cCoreView_Zoom        : Focuses on a single organism and manages information about it and its genotype.
+
+
+
+FROM NCURSES VIEWER
+
+viewer-text.cc		: Includes main() function
+cDriver_TextViewer	: 
+cTextViewerManager	
\ No newline at end of file

Added: development/source/targets/viewer-text/cDriver_TextViewer.cc
===================================================================
--- development/source/targets/viewer-text/cDriver_TextViewer.cc	                        (rev 0)
+++ development/source/targets/viewer-text/cDriver_TextViewer.cc	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,241 @@
+/*
+ *  cDriver_TextViewer.cc
+ *  Avida
+ *
+ *  Created by Charles on 7/1/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 "cDriver_TextViewer.h"
+
+#include "cAnalyze.h"
+#include "cChangeList.h"
+#include "cClassificationManager.h"
+#include "cGenotype.h"
+#include "cHardwareBase.h"
+#include "cOrganism.h"
+#include "cPopulation.h"
+#include "cPopulationCell.h"
+#include "cStats.h"
+#include "cString.h"
+#include "cStringList.h"
+#include "cWorld.h"
+
+#include "cDriverManager.h"
+#include "cTextViewerManager.h"
+
+#include <cstdlib>
+
+using namespace std;
+
+
+cDriver_TextViewer::cDriver_TextViewer(cWorld* world)
+  : m_world(world), m_done(false)
+{
+  // Setup the initial view mode (loaded from avida.cfg)
+  SetViewMode(world->GetConfig().VIEW_MODE.Get());
+
+  cDriverManager::Register(static_cast<cAvidaDriver*>(this));
+  world->SetDriver(this);
+}
+
+cDriver_TextViewer::~cDriver_TextViewer()
+{
+  cDriverManager::Unregister(static_cast<cAvidaDriver*>(this));
+  delete m_world;
+    
+  ExitTextViewer(0);
+}
+
+
+void cDriver_TextViewer::Run()
+{
+  cClassificationManager& classmgr = m_world->GetClassificationManager();
+  cPopulation& population = m_world->GetPopulation();
+  cStats& stats = m_world->GetStats();
+  
+  const int ave_time_slice = m_world->GetConfig().AVE_TIME_SLICE.Get();
+  const double point_mut_prob = m_world->GetConfig().POINT_MUT_PROB.Get();
+  
+  cAvidaContext ctx(m_world->GetRandom());
+  
+  while (!m_done) {
+    if (cChangeList* change_list = population.GetChangeList()) {
+      change_list->Reset();
+    }
+    
+    m_world->GetEvents(ctx);
+    if (m_done == true) break;
+    
+    // Increment the Update.
+    stats.IncCurrentUpdate();
+    
+    // Handle all data collection for previous update.
+    if (stats.GetUpdate() > 0) {
+      // Tell the stats object to do update calculations and printing.
+      stats.ProcessUpdate();
+      
+      // Update all the genotypes for the end of this update.
+      for (cGenotype * cur_genotype = classmgr.ResetThread(0);
+           cur_genotype != NULL && cur_genotype->GetThreshold();
+           cur_genotype = classmgr.NextGenotype(0)) {
+        cur_genotype->UpdateReset();
+      }
+    }
+    
+    
+    // Process the update.
+    const int UD_size = ave_time_slice * population.GetNumOrganisms();
+    const double step_size = 1.0 / (double) UD_size;
+    
+
+    // Are we stepping through an organism?
+    if (m_view.GetStepOrganism() != -1) {  // Yes we are!
+                                            // Keep the viewer informed about the organism we are stepping through...
+      for (int i = 0; i < UD_size; i++) {
+        const int next_id = population.ScheduleOrganism();
+        if (next_id == m_view.GetStepOrganism()) {
+          m_view.NotifyUpdate();
+          m_view.NewUpdate();
+          
+          // This is needed to have the top bar drawn properly; I'm not sure why...
+          static bool first_update = true;
+          if (first_update) {
+            m_view.Refresh();
+            first_update = false;
+          }
+        }
+        population.ProcessStep(ctx, step_size, next_id);
+      }
+    }
+    else {
+      for (int i = 0; i < UD_size; i++) population.ProcessStep(ctx, step_size);
+    }
+    
+    
+    // end of update stats...
+    population.CalcUpdateStats();
+    
+    
+    // Setup the viewer for the new update.
+    if (m_view.GetStepOrganism() == -1) {
+      m_view.NotifyUpdate();
+      m_view.NewUpdate();
+      
+      // This is needed to have the top bar drawn properly; I'm not sure why...
+      static bool first_update = true;
+      if (first_update) {
+        m_view.Refresh();
+        first_update = false;
+      }
+    }
+    
+    
+    // Do Point Mutations
+    if (point_mut_prob > 0 ) {
+      for (int i = 0; i < population.GetSize(); i++) {
+        if (population.GetCell(i).IsOccupied()) {
+          population.GetCell(i).GetOrganism()->GetHardware().PointMutate(ctx, point_mut_prob);
+        }
+      }
+    }
+    
+    // Exit conditons...
+    if (population.GetNumOrganisms() == 0) m_done = true;
+  }
+}
+
+
+void cDriver_TextViewer::SignalBreakpoint()
+{
+  m_view.DoBreakpoint();
+}
+
+
+void cDriver_TextViewer::Flush()
+{
+  // @CAO -- this is currently inefficient!
+
+  // Pull everything from the streams and put it into strings.
+  cString out_string(out_stream.str().c_str());
+  cString err_string(err_stream.str().c_str());
+
+  // Clear the streams.
+  out_stream.str("");
+  err_stream.str("");
+
+  // Split it into lines.
+  cStringList out_list(out_string, '\n');
+  cStringList err_list(err_string, '\n');
+  const int new_line_count = out_list.GetSize() + err_list.GetSize();
+
+  // And notify the output...
+  while (out_list.GetSize() > 0) {
+    m_view.NotifyOutput(out_list.Pop());
+  }
+
+  while (err_list.GetSize() > 0) {
+    cString cur_string(err_list.Pop());
+    cur_string.Insert("! ");
+    m_view.NotifyOutput(cur_string);
+  }
+
+  if (new_line_count > 0) m_view.NotifyOutput("");
+}
+
+
+bool cDriver_TextViewer::ProcessKeypress(int keypress)
+{
+  return m_view.ProcessKeypress(keypress);
+}
+
+
+void cDriver_TextViewer::RaiseException(const cString& in_string)
+{
+  m_view.NotifyError(in_string);
+}
+
+void cDriver_TextViewer::RaiseFatalException(int exit_code, const cString& in_string)
+{
+  m_view.NotifyError(in_string);
+  exit(exit_code);
+}
+
+void cDriver_TextViewer::NotifyComment(const cString& in_string)
+{
+  m_view.NotifyComment(in_string);
+}
+
+void cDriver_TextViewer::NotifyWarning(const cString& in_string)
+{
+  m_view.NotifyWarning(in_string);
+}
+
+
+void ExitTextViewer(int exit_code)
+{
+  signal(SIGINT, SIG_IGN);           // Ignore all future interupts.
+//  mvcur(0, COLS - 1, LINES - 1, 0);  // Move curser to the lower left.
+//  endwin();                          // Restore terminal mode.
+
+  printf ("Exit Code: %d\n", exit_code);
+
+  exit(exit_code);
+}
+

Added: development/source/targets/viewer-text/cDriver_TextViewer.h
===================================================================
--- development/source/targets/viewer-text/cDriver_TextViewer.h	                        (rev 0)
+++ development/source/targets/viewer-text/cDriver_TextViewer.h	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,82 @@
+/*
+ *  cDriver_TextViewer.h
+ *  Avida
+ *
+ *  Created by Charles on 7-1-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 cDriver_TextViewer_h
+#define cDriver_TextViewer_h
+
+#ifndef cAvidaDriver_h
+#include "cAvidaDriver.h"
+#endif
+
+#ifndef cCoreView_Info_h
+#include "cCoreView_Info.h"
+#endif
+ 
+
+#ifndef cWorldDriver_h
+#include "cWorldDriver.h"
+#endif
+
+#include <sstream>
+#include <iostream>
+
+class cWorld;
+
+
+class cDriver_TextViewer : public cAvidaDriver, public cWorldDriver {
+private:
+  cWorld* m_world;
+  cCoreView_Info info;
+
+  bool m_done;                 // This is set to true when run should finish.
+
+  cDriver_TextViewer();  // Intentionally not implemented
+public:
+  cDriver_TextViewer(cWorld* world);
+  ~cDriver_TextViewer();
+  
+  void Run();
+  
+  // Driver Actions
+  void SignalBreakpoint();
+  void SetDone() { m_done = true; }
+
+  void Flush();
+  bool ProcessKeypress(int keypress);
+  
+  void RaiseException(const cString& in_string);
+  void RaiseFatalException(int exit_code, const cString& in_string);
+  
+  // Notifications
+  void NotifyComment(const cString& in_string);
+  void NotifyWarning(const cString& in_string);
+
+  // Tests
+  bool IsInteractive() { return true; }
+};
+
+
+void ExitTextViewer(int exit_code);
+
+#endif

Added: development/source/targets/viewer-text/cTextViewerManager.cc
===================================================================
--- development/source/targets/viewer-text/cTextViewerManager.cc	                        (rev 0)
+++ development/source/targets/viewer-text/cTextViewerManager.cc	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,534 @@
+/*
+ *  cTextViewerManager.cc
+ *  Avida
+ *
+ *  Created by Charles on 7-1-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 "cTextViewerManager.h"
+
+#include "cEnvironment.h"
+#include "cGenotype.h"
+#include "cHardwareManager.h"
+#include "cOrganism.h"
+#include "cPhenotype.h"
+#include "cPopulation.h"
+#include "cPopulationCell.h"
+#include "cStats.h"
+#include "cTestCPU.h"
+#include "cHardwareBase.h"
+
+// #include "cMenuWindow.h"
+// #include "cTextWindow.h"
+// #include "cBarScreen.h"
+// #include "cMapScreen.h"
+// #include "cStatsScreen.h"
+// #include "cHistScreen.h"
+// #include "cOptionsScreen.h"
+// #include "cZoomScreen.h"
+// #include "cEnvironmentScreen.h"
+// #include "cAnalyzeScreen.h"
+
+#include "platform.h"
+
+#include <csignal>
+#include <fstream>
+
+#if AVIDA_PLATFORM(WINDOWS)
+# include <process.h>
+# define kill(x, y)
+#else
+# include <unistd.h>
+#endif
+
+using namespace std;
+
+
+cTextViewerManager::cTextViewerManager(cWorld* world) : info(world, this)
+{
+  Setup("Avida");
+
+//   map_screen     = new cMapScreen     (0,0,3,0,info, world->GetPopulation());
+//   stats_screen   = new cStatsScreen   (world, 0, 0, 3, 0, info);
+//   hist_screen    = new cHistScreen    (0,0,3,0,info, world->GetPopulation());
+//   options_screen = new cOptionsScreen (0,0,3,0,info);
+//   zoom_screen    = new cZoomScreen    (0,0,3,0,info, world->GetPopulation());
+//   environment_screen = new cEnvironmentScreen (world, 0, 0, 3, 0, info);
+//   analyze_screen = new cAnalyzeScreen(world, 0, 0, 3, 0, info);
+
+  info.SetActiveCell( &( world->GetPopulation().GetCell(0) ) );
+}
+
+cTextViewerManager::~cTextViewerManager()
+{
+//   if (map_screen) delete map_screen;
+//   if (stats_screen) delete stats_screen;
+//   if (hist_screen) delete hist_screen;
+//   if (options_screen) delete options_screen;
+//   if (zoom_screen) delete zoom_screen;
+//   if (environment_screen) delete environment_screen;
+//   if (analyze_screen) delete analyze_screen;
+
+  EndProg(0);
+}
+
+void cTextViewerManager::Setup(const cString & in_name)
+{
+  cur_screen = NULL;
+
+  // Setup text-interface
+
+  StartProg();
+
+//   bar_screen = new cBarScreen(&info.GetWorld(), 3, 0, 0, 0, info, in_name);
+//   base_window = new cTextWindow(0,0,3,0);
+//   bar_screen->Draw();
+}
+
+void cTextViewerManager::SetViewMode(int in_mode)
+{
+  if (in_mode == MODE_BLANK) {
+    cur_screen = NULL;
+//   } else if (in_mode == MODE_MAP) {
+//     cur_screen = map_screen;
+//   } else if (in_mode == MODE_STATS) {
+//     cur_screen = stats_screen;
+//   } else if (in_mode == MODE_HIST) {
+//     cur_screen = hist_screen;
+//   } else if (in_mode == MODE_OPTIONS) {
+//     cur_screen = options_screen;
+//   } else if (in_mode == MODE_ZOOM) {
+//     cur_screen = zoom_screen;
+//   } else if (in_mode == MODE_ENVIRONMENT) {
+//     cur_screen = environment_screen;
+//   } else if (in_mode == MODE_ANALYZE) {
+//     cur_screen = analyze_screen;
+  }
+}
+
+void cTextViewerManager::Refresh()
+{
+  ChangeCurScreen(cur_screen);
+//  bar_screen->Redraw();
+}
+
+void cTextViewerManager::Redraw()
+{
+//   bar_screen->Redraw();
+  if (cur_screen) cur_screen->Redraw();
+  else base_window->Redraw();
+}
+
+void cTextViewerManager::NewUpdate()
+{
+  if (info.GetPauseLevel() == PAUSE_ADVANCE_STEP) {
+    return;
+  }
+  NotifyUpdate();
+}
+
+void cTextViewerManager::NotifyUpdate()
+{
+//   bar_screen->Update();
+  info.UpdateSymbols();
+
+  if (cur_screen) cur_screen->Update();
+  DoInputs();
+}
+
+void cTextViewerManager::NotifyError(const cString & in_string)
+{
+  cString out_string(in_string);
+  out_string.Insert("Error: ");
+  Notify(out_string);
+  EndProg(1);
+}
+
+void cTextViewerManager::NotifyWarning(const cString & in_string)
+{
+  cString out_string(in_string);
+  out_string.Insert("Warning: ");
+  Notify(out_string);
+}
+
+void cTextViewerManager::NotifyComment(const cString & in_string)
+{
+  if (cur_screen == analyze_screen) analyze_screen->Notify(in_string);
+  else Notify(in_string);
+}
+
+void cTextViewerManager::NotifyOutput(const cString & in_string)
+{
+//   analyze_screen->Notify(in_string);
+//   if (cur_screen == analyze_screen) analyze_screen->Refresh();
+}
+
+void cTextViewerManager::DoBreakpoint()
+{
+  if (info.GetPauseLevel() == PAUSE_OFF ||
+      info.GetPauseLevel() == PAUSE_ADVANCE_UPDATE) {
+    Pause();
+    NotifyUpdate();
+  }
+}
+
+void cTextViewerManager::DoInputs()
+{
+  // If we are paused, delay doing anything else until a key is pressed.
+  if (info.GetPauseLevel() != PAUSE_OFF) nodelay(stdscr, false);
+
+  // If we are in step-wise mode, "finish" this step!
+  if (info.GetPauseLevel() == PAUSE_ADVANCE_STEP) {
+    info.DisEngageStepMode();
+    info.SetPauseLevel(PAUSE_ON);
+  }
+
+  // If there is any input in the buffer, process all of it.
+  int cur_char = ERR;
+  while ((cur_char = GetInput()) != ERR || info.GetPauseLevel() == PAUSE_ON) {
+    bool found_keypress = ProcessKeypress(cur_char);
+
+    // If we couldn't manage the keypress here, check the current screen.
+    if (found_keypress == false && cur_screen) cur_screen->DoInput(cur_char);
+  }
+
+  if (info.GetPauseLevel() == PAUSE_ADVANCE_UPDATE) {
+    info.SetPauseLevel(PAUSE_ON);
+  }
+
+  nodelay(stdscr, true);
+}
+
+bool cTextViewerManager::ProcessKeypress(int keypress)
+{
+  bool unknown = false;
+
+  switch (keypress) {
+//   case 'a':
+//   case 'A':
+//     ChangeCurScreen(analyze_screen);
+//     break;
+  case 'b':
+  case 'B':
+    ChangeCurScreen(NULL);
+    break;
+//   case 'C':
+//   case 'c':
+//     NavigateMapWindow();
+//     // Now we need to restore the proper window mode (already cleared)
+//     ChangeCurScreen(cur_screen);
+//     break;
+//   case 'e':
+//   case 'E':
+//     ChangeCurScreen(environment_screen);
+//     break;
+//   case 'h':
+//   case 'H':
+//     ChangeCurScreen(hist_screen);
+//     break;
+//   case 'm':
+//   case 'M':
+//     ChangeCurScreen(map_screen);
+//     break;
+//   case 'n':
+//   case 'N':
+//     if (info.GetPauseLevel() == PAUSE_ON) {
+//       info.SetPauseLevel(PAUSE_ADVANCE_UPDATE);
+//       // parasite_zoom = false; // if executing, show code that is running
+//       info.GetActiveCell()->GetOrganism()->GetPhenotype().SetFault("");
+//       nodelay(stdscr, true); // Don't delay for input; get to processing.
+//     }
+//     if (cur_screen) cur_screen->AdvanceUpdate();
+//     break;
+//   case 'o':
+//   case 'O':
+//     ChangeCurScreen(options_screen);
+//     break;
+  case 'p':
+  case 'P':
+    TogglePause();
+    // We don't want to delay if we're unpaused.
+    if (info.GetPauseLevel() == PAUSE_OFF) nodelay(stdscr, true);
+    else nodelay(stdscr, false);
+    break;
+  case 'q':
+    if (!Confirm("Are you sure you want to quit?")) break;
+  case 'Q':      // Note: Capital 'Q' quits w/o confirming.
+    // clear the windows before we go.  Do bar window last to end at top.
+    base_window->Redraw();
+    bar_screen->Clear();
+    bar_screen->Refresh();
+    EndProg(0);  // This implementation calls exit(), blowing us clean away
+    break;
+//   case 's':
+//   case 'S':
+//     ChangeCurScreen(stats_screen);
+//     break;
+//   case 'W':
+//   case 'w':
+//     CloneSoup();
+//     break;
+//   case 'X':
+//   case 'x':
+//     ExtractCreature();
+//     break;
+//   case 'z':
+//   case 'Z':
+//     ChangeCurScreen(zoom_screen);
+//     break;
+  case 3: // CTRL-C...
+    exit(0);
+    break;
+  case 12: // CTRL-L...
+    Refresh();
+    break;
+  case 26: // CTRL-Z
+    kill(getpid(), SIGTSTP);
+    break;
+//   case '*':   // Test Key!!!
+//     if (true) {
+//       Confirm("Starting Tests.");
+//       cMenuWindow menu(50);
+//       char message[40];
+//       for (int j = 0; j < 50; j++) {
+// 	sprintf(message, "Line %d", j);
+// 	menu.AddOption(j, message);
+//       }
+//       menu.SetActive(3);
+//       menu.Activate(base_window);
+//       Redraw();
+//     }
+//     break;
+  case ERR:
+    break;
+  default:
+    unknown = true;
+    break;
+  }
+
+  return !unknown;
+}
+
+void cTextViewerManager::TogglePause()
+{
+  // If the run is already paused, un-pause it!
+  if (info.GetPauseLevel() != PAUSE_OFF) {
+    info.DisEngageStepMode();
+    info.SetPauseLevel(PAUSE_OFF);
+    if (info.GetActiveCell()->IsOccupied()) {
+      info.GetActiveCell()->GetOrganism()->GetPhenotype().SetFault("");
+    }
+  }
+
+  // Otherwise, turn on the pause.
+  else {
+    info.SetPauseLevel(PAUSE_ON);
+  }
+
+  // Redraw the screen to account for the toggled pause.
+  if (cur_screen) cur_screen->Draw();
+}
+
+void cTextViewerManager::CloneSoup()
+{
+  cString filename;
+  filename.Set("clone.%d", info.GetWorld().GetStats().GetUpdate());
+  ofstream fp(static_cast<const char*>(filename));
+  info.GetPopulation().SaveClone(fp);
+  cString message;
+  message.Set("Saved clone to file: %s", static_cast<const char*>(filename));
+  Notify(message);
+}
+
+void cTextViewerManager::ExtractCreature()
+{
+  cGenotype * cur_gen = info.GetActiveGenotype();
+  cString gen_name = cur_gen->GetName();
+
+  if (gen_name == "(no name)")
+    gen_name.Set("%03d-unnamed", cur_gen->GetLength());
+
+  if (cur_screen) cur_screen->Print(20, 0, "Extracting %s...", static_cast<const char*>(gen_name));
+
+  cTestCPU* testcpu = info.GetWorld().GetHardwareManager().CreateTestCPU();
+  testcpu->PrintGenome(info.GetWorld().GetDefaultContext(), cur_gen->GetGenome(), gen_name);
+  delete testcpu;
+
+  if (cur_screen) {
+    cur_screen->Print(20, 24, "Done.");
+    cur_screen->Refresh();
+  }
+}
+
+
+void cTextViewerManager::ChangeCurScreen(cScreen* new_screen)
+{
+  if (cur_screen) cur_screen->Exit();
+
+  cur_screen = new_screen;
+  base_window->Redraw();
+  bar_screen->Redraw();
+  if (cur_screen) {
+    cur_screen->Clear();
+    cur_screen->Draw();
+  }
+}
+
+// void cTextViewerManager::PrintMerit(int in_y, int in_x, double in_merit)
+// {
+//   // if we can print the merit normally, do so.
+//   if (in_merit < 1000000.0) {
+//     if (cur_screen) cur_screen->Print(in_y, in_x, "%d", ((int) in_merit));
+//   }
+
+//   // otherwise use scientific notation. (or somesuch)
+//   else {
+//     if (cur_screen) cur_screen->Print(in_y, in_x, "%7.1e", in_merit);
+//   }
+// }
+
+// void cTextViewerManager::PrintFitness(int in_y, int in_x, double in_fitness)
+// {
+//   if (!cur_screen) return;
+
+//   // If we can print the fitness, do so!
+//   if (in_fitness <= 0.0) {
+//     cur_screen->Print(in_y, in_x, " 0.0000");
+//   }
+//   else if (in_fitness < 10)
+//     cur_screen->Print(in_y, in_x, "%7.4f", in_fitness);
+//   //  else if (in_fitness < 100)
+//   //    cur_screen->Print(in_y, in_x, "%7.3f", in_fitness);
+//   else if (in_fitness < 1000)
+//     cur_screen->Print(in_y, in_x, "%7.2f", in_fitness);
+//   //  else if (in_fitness < 10000)
+//   //    cur_screen->Print(in_y, in_x, "%7.1f", in_fitness);
+//   else if (in_fitness < 100000)
+//     cur_screen->Print(in_y, in_x, "%7.0f", in_fitness);
+
+//   // Otherwise use scientific notations.
+//   else
+//     cur_screen->Print(in_y, in_x, "%7.1e", in_fitness);
+// }
+
+void cTextViewerManager::NavigateMapWindow()
+{
+//   map_screen->Navigate();
+}
+
+
+int cTextViewerManager::Confirm(const cString & message)
+{
+  const int mess_length = message.GetSize();
+
+  // Create a confirm window, and draw it on the screen.
+
+  cTextWindow * conf_win
+    = new cTextWindow(3, mess_length + 10, 10, (base_window->Width() - 10 - mess_length) / 2);
+  conf_win->Box();
+  conf_win->SetBoldColor(COLOR_WHITE);
+  conf_win->Print(1, 2, "%s (y/n)", static_cast<const char*>(message));
+  conf_win->SetBoldColor(COLOR_CYAN);
+  conf_win->Print(1, mess_length + 4, 'y');
+  conf_win->Print(1, mess_length + 6, 'n');
+  conf_win->SetColor(COLOR_WHITE);
+  conf_win->Refresh();
+
+  // Wait for the results.
+  bool finished = false;
+  bool result = false;
+  int cur_char;
+
+  while (finished == false) {
+    cur_char = GetInput();
+    switch (cur_char) {
+    case 'q':
+    case 'Q':
+    case 'n':
+    case 'N':
+    case ' ':
+    case '\n':
+    case '\r':
+      finished = true;
+      result = false;
+      break;
+    case 'y':
+    case 'Y':
+      finished = true;
+      result = true;
+      break;
+    }
+  }
+
+  // Delete the window, redraw the screen, and return the results.
+  delete conf_win;
+  Redraw();
+  return result;
+}
+
+void cTextViewerManager::Notify(const cString & message)
+{
+  cString mess_copy(message);
+
+  // Setup all of the individual lines.
+  int num_lines = message.CountNumLines();
+  cString * line_array = new cString[num_lines];
+  int max_width = 0;
+  for (int i = 0; i < num_lines; i++) {
+    line_array[i] = mess_copy.PopLine();
+    if (line_array[i].GetSize() > max_width)
+      max_width = line_array[i].GetSize();
+  }
+
+  // Create a window and draw it on the screen.
+
+  cTextWindow * notify_win
+    = new cTextWindow(2 + num_lines, max_width + 4, (24 - num_lines - 3) / 2,
+		      (70 - max_width) / 2);
+  notify_win->Box();
+  notify_win->SetBoldColor(COLOR_WHITE);
+  for (int j = 0; j < num_lines; j++) {
+    notify_win->Print(1 + j, 2, "%s", static_cast<const char*>(line_array[j]));
+  }
+  notify_win->Refresh();
+
+  // Wait for the results.
+  bool finished = false;
+  int cur_char;
+
+  while (!finished) {
+    cur_char = GetInput();
+    switch (cur_char) {
+    case 'q':
+    case 'Q':
+    case ' ':
+    case '\n':
+    case '\r':
+      finished = true;
+      break;
+    }
+  }
+
+  // Delete the window and redraw the screen.
+  delete notify_win;
+  delete [] line_array;
+  Redraw();
+}
+

Added: development/source/targets/viewer-text/cTextViewerManager.h
===================================================================
--- development/source/targets/viewer-text/cTextViewerManager.h	                        (rev 0)
+++ development/source/targets/viewer-text/cTextViewerManager.h	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,123 @@
+/*
+ *  cTextViewerManager.h
+ *  Avida
+ *
+ *  Created by Charles on 7-1-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 cTextViewerManager_h
+#define cTextViewerManager_h
+
+#ifndef cString_h
+#include "cString.h"
+#endif
+
+#ifndef cCoreView_Info_h
+#include "cCoreView_Info.h"
+#endif
+
+class cScreen;
+class cTextWindow;
+class cBarScreen;
+class cMapScreen;
+class cStatsScreen;
+class cHistScreen;
+class cOptionsScreen;
+class cZoomScreen;
+class cEnvironmentScreen;
+class cAnalyzeScreen;
+class cWorld;
+
+class cTextViewerManager {
+private:
+  cCoreView_Info info;
+
+  // Window information...
+  cTextWindow * base_window;
+  cScreen * cur_screen;
+  cBarScreen * bar_screen;
+  cMapScreen * map_screen;
+  cStatsScreen * stats_screen;
+  cHistScreen * hist_screen;
+  cOptionsScreen * options_screen;
+  cZoomScreen * zoom_screen;
+  cEnvironmentScreen * environment_screen;
+  cAnalyzeScreen * analyze_screen;
+
+  // Window managing functions...
+
+  void TogglePause();
+  void CloneSoup();
+  void ExtractOrganism();
+
+  // Input function
+  void DoInputs();
+
+  // Screen helpers
+  void ChangeCurScreen(cScreen * new_screen);
+  void PrintMerit(int in_y, int in_x, double in_merit);
+  void PrintFitness(int in_y, int in_x, double in_fitness);
+
+  // Map navigation
+  void NavigateMapWindow();
+
+public:
+  enum eTextViewerMode {
+    MODE_BLANK       = 0,
+    MODE_MAP         = 1,
+    MODE_STATS       = 2,
+    MODE_HIST        = 3,
+    MODE_OPTIONS     = 4,
+    MODE_ZOOM        = 5,
+    MODE_ENVIRONMENT = 6,
+    MODE_ANALYZE     = 7
+  };
+
+  cTextViewerManager(cWorld* world);
+  virtual ~cTextViewerManager();
+
+  void Setup(const cString & in_name);
+  void SetViewMode(int in_mode);
+
+  bool ProcessKeypress(int keypress);
+
+  void NewUpdate();
+  void NotifyUpdate();
+  void NotifyError(const cString & in_string);
+  void NotifyWarning(const cString & in_string);
+  void NotifyComment(const cString & in_string);
+  void NotifyOutput(const cString & in_string);
+  void Pause() { info.SetPauseLevel(cCoreView_Info::PAUSE_ON); }
+  void DoBreakpoint();
+  
+  int Confirm(const cString & message);
+  void Notify(const cString & message);
+
+  int GetStepOrganism() { return info.GetStepOrganism(); }
+  void SetStepOrganism(int in_id) { info.SetStepOrganism(in_id); }
+
+  void Refresh();
+
+  // Methods called by sub-windows.
+  void Redraw();
+};
+
+
+#endif

Added: development/source/targets/viewer-text/viewer-text.cc
===================================================================
--- development/source/targets/viewer-text/viewer-text.cc	                        (rev 0)
+++ development/source/targets/viewer-text/viewer-text.cc	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,65 @@
+/*
+ *  viewer.cc
+ *  Avida
+ *
+ *  Created by Charles on 7/1/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 <csignal>
+
+#include "avida.h"
+#include "cAvidaConfig.h"
+#include "cDriverManager.h"
+#include "PlatformExpert.h"
+#include "cWorld.h"
+
+#include "cDriver_TextViewer.h"
+
+
+using namespace std;
+
+
+int main(int argc, char * argv[])
+{
+  PlatformExpert::Initialize();
+  
+  printVersionBanner();
+  
+  // Initialize the configuration data...
+  cWorld* world = new cWorld(cAvidaConfig::LoadWithCmdLineArgs(argc, argv));
+  cAvidaDriver* driver = NULL;
+  
+  // Test to see if we should be in analyze mode only...
+  if (world->GetConfig().ANALYZE_MODE.Get() > 0); // @CAO Do something here...
+
+  driver = new cDriver_TextViewer(world);
+
+  cout << "We Made IT!  Now we stop." << endl;
+  exit(0);
+
+  cout << endl;
+  
+  driver->Run();
+  
+  // Exit Nicely
+  ExitAvida(0);
+  
+  return 0;
+}

Added: development/source/viewer-core/LAYOUT
===================================================================
--- development/source/viewer-core/LAYOUT	                        (rev 0)
+++ development/source/viewer-core/LAYOUT	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,20 @@
+= Controllers =
+cCoreView_Info : contains all of the basic information that is shared among the view modes, and info about the 
+	current viewer hooked up to Avida.
+
+	- Which view modes are actively associated with this information?
+	- Which population are they hooked up to?
+	- What is the world shape and size?
+	- How many distinct colors does the viewer have to work with?
+	- What pause level are we at?
+
+cCoreView_Base : A generic base class for all of the view modes.
+
+= Modes =
+cCoreView_Analyze     : Manages analyze mode
+cCoreView_Config      : Handles the interface to the configuration files.
+cCoreView_Environment : Manages all of the information about the environment for the current population.
+cCoreView_Hist        : Maintains histograms about various stats for the current population.
+cCoreView_Map         : Manages all of the information for a single map screen.
+cCoreView_Stats       : Deals with the interface to the cStats object with info about the current population.
+cCoreView_Zoom        : Focuses on a single organism and manages information about it and its genotype.

Added: development/source/viewer-core/cCoreView_Info.cc
===================================================================
--- development/source/viewer-core/cCoreView_Info.cc	                        (rev 0)
+++ development/source/viewer-core/cCoreView_Info.cc	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,17 @@
+#include "cCoreView_Info.h"
+
+cCoreView_Info::cCoreView_Info(cPopulation & in_pop, int in_total_colors)
+  : m_population(in_pop)
+  , m_total_colors(in_total_colors)
+  , m_threshold_colors(in_total_colors * 5 / 6)
+  , m_pause_level(PAUSE_OFF)
+  , m_step_organism(-1)
+{
+  // Redirect standard output...
+  std::cout.rdbuf(out_stream.rdbuf());
+  std::cerr.rdbuf(err_stream.rdbuf());
+}
+
+cCoreView_Info::~cCoreView_Info()
+{
+}

Added: development/source/viewer-core/cCoreView_Info.h
===================================================================
--- development/source/viewer-core/cCoreView_Info.h	                        (rev 0)
+++ development/source/viewer-core/cCoreView_Info.h	2007-07-03 18:05:02 UTC (rev 1747)
@@ -0,0 +1,50 @@
+#ifndef cCoreView_Info_h
+#define cCoreView_Info_h
+
+// The cCoreView_Info object is responsible for holding on to all of the general information about the state of
+// a population in the view.  It does not process any of this information, but allows it to be easily shared by
+// all of the sections of the viewer.
+
+#include <iostream>
+#include<sstream>
+
+#include "tList.h"
+
+class cPopulation;
+class cCoreView_Base;
+
+class cCoreView_Info {
+protected:
+  cPopulation & m_population;
+
+  // Setup streams to capture stdin and stdout so we can control them as needed.
+  std::stringstream out_stream;
+  std::stringstream err_stream;
+
+  // Constant Inforation setup by specific viewer.
+  const int m_total_colors;
+  const int m_threshold_colors;
+
+  // Variable information, changing modes based on user input.
+  int m_pause_level;
+  int m_step_organism;
+
+public:
+  // Constant Information across all viewers.
+  enum ePause { PAUSE_ON, PAUSE_OFF, PAUSE_ADVANCE_INST, PAUSE_ADVANCE_UPDATE, PAUSE_ADVANCE_DIVIDE };
+
+public:
+  cCoreView_Info(cPopulation & in_pop, int in_total_colors);
+  ~cCoreView_Info();
+
+  cPopulation & GetPopulation() { return m_population; }
+
+  // Accessors for variable information
+  int GetPauseLevel() { return m_pause_level; }
+  int GetStepOrganism() { return m_step_organism; }
+
+  void SetPauseLevel(int in_level) { m_pause_level = in_level; }
+  void SetStepOrganism(int in_id) { m_step_organism = in_id; }
+};
+
+#endif




More information about the Avida-cvs mailing list