@@ -59,6 +59,7 @@ class ProgramBuilder : emp::vector<sgpl::Instruction<Spec>> {
5959 push_back (inst);
6060 }
6161
62+
6263 sgpl::Program<Spec> Build (size_t length) {
6364 Add (" Reproduce" );
6465
@@ -102,15 +103,6 @@ class ProgramBuilder : emp::vector<sgpl::Instruction<Spec>> {
102103 Add (" SharedIO" );
103104 }
104105
105- void AddPrivateNot () {
106- // privateio r0
107- // nand r0, r0, r0
108- // privateio r0
109- Add (" PrivateIO" );
110- Add (" Nand" );
111- Add (" PrivateIO" );
112- }
113-
114106 void AddNand () {
115107 // sharedio r0
116108 // sharedio r1
@@ -122,17 +114,6 @@ class ProgramBuilder : emp::vector<sgpl::Instruction<Spec>> {
122114 Add (" SharedIO" );
123115 }
124116
125- void AddPrivateNand () {
126- // sharedio r0
127- // sharedio r1
128- // nand r0, r1, r0
129- // sharedio r0
130- Add (" PrivateIO" );
131- Add (" PrivateIO" , 1 );
132- Add (" Nand" , 0 , 1 , 0 );
133- Add (" PrivateIO" );
134- }
135-
136117 void AddAnd () {
137118 // ~(a nand b)
138119 // sharedio r0
@@ -298,7 +279,8 @@ class ProgramBuilder : emp::vector<sgpl::Instruction<Spec>> {
298279 * Output: None.
299280 *
300281 * Purpose: Spread out donate instructions throughout the organism's genome in order to allow donations
301- * during a symbiont's entire genome and not just in one place. Without the spread of instructions symbionts were unable to donate regularly.
282+ * during a symbiont's entire genome and not just in one place. Without the spread of
283+ * instructions symbionts were unable to donate regularly.
302284 */
303285 void AddStartDonate (int donate_count){
304286
@@ -319,17 +301,39 @@ class ProgramBuilder : emp::vector<sgpl::Instruction<Spec>> {
319301 }
320302};
321303
304+
305+ /* *
306+ * Input: Total length of program
307+ *
308+ * Output: Program that contains only a Reproduce instruction
309+ *
310+ * Purpose: Used for testing reproduction
311+ */
322312sgpl::Program<Spec> CreateReproProgram (size_t length) {
323313 ProgramBuilder program;
324314 return program.Build (length);
325315}
326316
317+ /* *
318+ * Input: Total length of program
319+ *
320+ * Output: Program that performs a NOT operation
321+ *
322+ * Purpose: Creates the program for the majority of starting organisms
323+ */
327324sgpl::Program<Spec> CreateNotProgram (size_t length) {
328325 ProgramBuilder program;
329326 program.AddNot ();
330327 return program.Build (length);
331328}
332329
330+ /* *
331+ * Input: Total length of program and the number of steal instructions that should be in the program
332+ *
333+ * Output: Program that performs a NOT operation and contains steal instructions
334+ *
335+ * Purpose: Creates a program for starting parasite symbionts when DONATION_STEAL_INST is enabled
336+ */
333337sgpl::Program<Spec> CreateParasiteNotProgram (size_t length, int steal_count) {
334338 ProgramBuilder program;
335339 if (steal_count < 0 ){
@@ -347,6 +351,14 @@ sgpl::Program<Spec> CreateParasiteNotProgram(size_t length, int steal_count) {
347351 return program.Build (length);
348352}
349353
354+
355+ /* *
356+ * Input: Total length of program and the number of donate instructions that should be in the program
357+ *
358+ * Output: Program that performs a NOT operation and contains donate instructions
359+ *
360+ * Purpose: Creates a program for starting mutualist symbionts when DONATION_STEAL_INST is enabled
361+ */
350362sgpl::Program<Spec> CreateMutualistNotProgram (size_t length, int donate_count) {
351363 ProgramBuilder program;
352364 if (donate_count < 0 ){
@@ -363,6 +375,14 @@ sgpl::Program<Spec> CreateMutualistNotProgram(size_t length, int donate_count) {
363375 return program.Build (length);
364376}
365377
378+
379+ /* *
380+ * Input: Total length of program
381+ *
382+ * Output: Program that performs the EQU operation
383+ *
384+ * Purpose: Creates a program that is able to perform EQU and reproduce, used for testing
385+ */
366386sgpl::Program<Spec> CreateEquProgram (size_t length) {
367387 ProgramBuilder program;
368388 program.AddEqu ();
@@ -371,8 +391,11 @@ sgpl::Program<Spec> CreateEquProgram(size_t length) {
371391
372392
373393/* *
374- * Picks what type of starting program should be created based on the config and
375- * creates it.
394+ * Input: A config file
395+ *
396+ * Output: Program for starting symbionts based on config
397+ *
398+ * Purpose: Assigns the correct program to the starting symbionts of the world
376399 */
377400sgpl::Program<Spec> CreateStartProgram (emp::Ptr<SymConfigSGP> config) {
378401 if (config->DONATION_STEAL_INST () == 1 ){
0 commit comments