[Avida-cvs] [avida-svn] r1017 - branches/coopcomm/source/main
beckma24 at myxo.css.msu.edu
beckma24 at myxo.css.msu.edu
Fri Sep 29 12:26:10 PDT 2006
Author: beckma24
Date: 2006-09-29 15:26:10 -0400 (Fri, 29 Sep 2006)
New Revision: 1017
Modified:
branches/coopcomm/source/main/cTaskLib.cc
branches/coopcomm/source/main/cTaskLib.h
Log:
Added send-not-toward-sink task
Modified: branches/coopcomm/source/main/cTaskLib.cc
===================================================================
--- branches/coopcomm/source/main/cTaskLib.cc 2006-09-29 18:05:59 UTC (rev 1016)
+++ branches/coopcomm/source/main/cTaskLib.cc 2006-09-29 19:26:10 UTC (rev 1017)
@@ -356,6 +356,8 @@
NewTask(name, "Reward the sending of the sender's ID.", &cTaskLib::Task_SendSelf);
else if(name == "send-toward-sink")
NewTask(name, "Reward the sender for sending toward the sink", &cTaskLib::Task_SendTowardSink);
+ else if(name == "send-not-toward-sink")
+ NewTask(name, "Reward the sender for not sending toward the sink", &cTaskLib::Task_SendNotTowardSink);
// Make sure we have actually found a task
if (task_array.GetSize() == start_size) {
@@ -1980,4 +1982,10 @@
}
}
return 0.0;
+}
+
+double cTaskLib::Task_SendNotTowardSink(cTaskContext* ctx) const {
+ if(Task_SendTowardSink(ctx) == 0.0)
+ return 1.0;
+ return 0.0;
}
\ No newline at end of file
Modified: branches/coopcomm/source/main/cTaskLib.h
===================================================================
--- branches/coopcomm/source/main/cTaskLib.h 2006-09-29 18:05:59 UTC (rev 1016)
+++ branches/coopcomm/source/main/cTaskLib.h 2006-09-29 19:26:10 UTC (rev 1017)
@@ -240,6 +240,8 @@
//! Reward an organism for sending message to organism who is closer to the sink
double Task_SendTowardSink(cTaskContext* ctx) const;
+ //! Reward an organism for sending message to organism who is not closer to the sink
+ double Task_SendNotTowardSink(cTaskContext* ctx) const;
};
More information about the Avida-cvs
mailing list