[Avida-cvs] [avida-svn] r983 - in branches/coopcomm: Avida.xcodeproj source/actions source/main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Mon Sep 25 10:39:00 PDT 2006


Author: beckma24
Date: 2006-09-25 13:39:00 -0400 (Mon, 25 Sep 2006)
New Revision: 983

Modified:
   branches/coopcomm/Avida.xcodeproj/project.pbxproj
   branches/coopcomm/source/actions/PopulationActions.cc
   branches/coopcomm/source/actions/SaveLoadActions.cc
   branches/coopcomm/source/main/cPopulation.h
Log:
Added SetStaticBaseStation event

Modified: branches/coopcomm/Avida.xcodeproj/project.pbxproj
===================================================================
--- branches/coopcomm/Avida.xcodeproj/project.pbxproj	2006-09-25 13:44:54 UTC (rev 982)
+++ branches/coopcomm/Avida.xcodeproj/project.pbxproj	2006-09-25 17:39:00 UTC (rev 983)
@@ -373,6 +373,23 @@
 		};
 /* End PBXBuildRule section */
 
+/* Begin PBXBuildStyle section */
+		B57131160AC81ECA000A6C36 /* Development */ = {
+			isa = PBXBuildStyle;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+			};
+			name = Development;
+		};
+		B57131170AC81ECA000A6C36 /* Deployment */ = {
+			isa = PBXBuildStyle;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+			};
+			name = Deployment;
+		};
+/* End PBXBuildStyle section */
+
 /* Begin PBXCopyFilesBuildPhase section */
 		700E2B6D085DE50C00CF158A /* CopyFiles */ = {
 			isa = PBXCopyFilesBuildPhase;
@@ -921,7 +938,7 @@
 		DCC315CF076253A5008F7A48 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
 		DCC315D0076253A5008F7A48 /* task_event_gen.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.cc; sourceTree = "<group>"; };
 		DCC315D1076253A5008F7A48 /* task_event_gen.old.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.old.cc; sourceTree = "<group>"; };
-		DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
+		DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -1759,6 +1776,12 @@
 		DCC30C4D0762532C008F7A48 /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 702442D70859E0B00059BD9B /* Build configuration list for PBXProject "Avida" */;
+			buildSettings = {
+			};
+			buildStyles = (
+				B57131160AC81ECA000A6C36 /* Development */,
+				B57131170AC81ECA000A6C36 /* Deployment */,
+			);
 			hasScannedForEncodings = 0;
 			mainGroup = DCC30C490762532C008F7A48;
 			productRefGroup = DCC3164E07626CF3008F7A48 /* Products */;

Modified: branches/coopcomm/source/actions/PopulationActions.cc
===================================================================
--- branches/coopcomm/source/actions/PopulationActions.cc	2006-09-25 13:44:54 UTC (rev 982)
+++ branches/coopcomm/source/actions/PopulationActions.cc	2006-09-25 17:39:00 UTC (rev 983)
@@ -1185,8 +1185,33 @@
   }
 };
 
+/**
+  Written by: Ben Beckmann
+ Action to set an organism as a base station.  Multiple base stations are not allowed yet
+ 
+ Parameters:
+   The cell ID of the base station
+**/
+class cActionSetStaticBaseStation : public cAction
+{
+private:
+  int baseStation;
+  
+public:
+  cActionSetStaticBaseStation(cWorld* world, const cString& args) : cAction(world, args)
+  {
+    cString largs(args);
+    if (largs.IsNumber()) baseStation = largs.AsInt();
+  }
+  
+  static const cString GetDescription() { return "Arguments: [int baseStationCellID]"; }
+  
+  void Process(cAvidaContext& ctx)
+  {
+    m_world->GetPopulation().AddBaseStation(baseStation);
+  }
+};
 
-
 void RegisterPopulationActions(cActionLibrary* action_lib)
 {
   action_lib->Register<cActionInject>("Inject");
@@ -1219,6 +1244,9 @@
   action_lib->Register<cActionConnectCells>("ConnectCells");
   action_lib->Register<cActionDisconnectCells>("DisconnectCells");
 
+  action_lib->Register<cActionSetStaticBaseStation>("SetStaticBaseStation");
+
+
   // @DMB - The following actions are DEPRECATED aliases - These will be removed in 2.7.
   action_lib->Register<cActionInject>("inject");
   action_lib->Register<cActionInjectRandom>("inject_random");

Modified: branches/coopcomm/source/actions/SaveLoadActions.cc
===================================================================
--- branches/coopcomm/source/actions/SaveLoadActions.cc	2006-09-25 13:44:54 UTC (rev 982)
+++ branches/coopcomm/source/actions/SaveLoadActions.cc	2006-09-25 17:39:00 UTC (rev 983)
@@ -303,7 +303,6 @@
   }
 };
 
-
 void RegisterSaveLoadActions(cActionLibrary* action_lib)
 {
   action_lib->Register<cActionSaveClone>("SaveClone");

Modified: branches/coopcomm/source/main/cPopulation.h
===================================================================
--- branches/coopcomm/source/main/cPopulation.h	2006-09-25 13:44:54 UTC (rev 982)
+++ branches/coopcomm/source/main/cPopulation.h	2006-09-25 17:39:00 UTC (rev 983)
@@ -37,7 +37,11 @@
 #ifndef tList_h
 #include "tList.h"
 #endif
+#ifndef tVector_h
+#include "tVector.h"
+#endif
 
+
 class cAvidaContext;
 class cCodeLabel;
 class cChangeList;
@@ -64,7 +68,8 @@
 
   // Data Tracking...
   tList<cPopulationCell> reaper_queue; // Death order in some mass-action runs
-
+  tVector<int> baseStations;
+  
   // Default organism setups...
   cEnvironment & environment;          // Physics & Chemestry description
 
@@ -185,6 +190,7 @@
 
   void SetChangeList(cChangeList* change_list);
   cChangeList* GetChangeList();
+  void AddBaseStation(int cell_ID) {baseStations.Add(cell_ID);}
 };
 
 




More information about the Avida-cvs mailing list