Index: /trunk/packages/optimizer/examples/app-qdot.tcl
===================================================================
--- /trunk/packages/optimizer/examples/app-qdot.tcl	(revision 1165)
+++ /trunk/packages/optimizer/examples/app-qdot.tcl	(revision 1166)
@@ -24,11 +24,18 @@
 set popsize 100  ;# size of each population for genetic algorithm
 
+set xml_path [lindex $argv 0]
+puts $xml_path
+
+
 # ----------------------------------------------------------------------
 #  Create a Tool object based on the tool.xml file...
 # ----------------------------------------------------------------------
 Rappture::getopts argv params {
-    value -tool tool.xml
+     value -tool tool.xml
 }
 
+after 2000
+puts $params(-tool)
+after 2000
 #blt::bltdebug 100
 
Index: /trunk/packages/optimizer/examples/simple.tcl
===================================================================
--- /trunk/packages/optimizer/examples/simple.tcl	(revision 1165)
+++ /trunk/packages/optimizer/examples/simple.tcl	(revision 1166)
@@ -23,5 +23,5 @@
 set auto_path [linsert $auto_path 0 /home/ganesh/workspace/optim_post_dir_changes/src/lib]
 package require -exact RapptureOptimizer 1.1
-set popsize 100  ;# size of each population for genetic algorithm
+
 
 # ----------------------------------------------------------------------
@@ -64,4 +64,7 @@
 button .quit -text Quit -command "optim abort yes"
 pack .quit
+button .restart -text Restart -command "optim restart yes"
+pack .restart
+
 set colors {magenta purple blue DeepSkyBlue cyan green yellow Gold orange tomato red FireBrick black}
 
@@ -97,9 +100,10 @@
 Rappture::optimizer optim -tool $tool -using pgapack
 
-optim add number input.number(x1) -min -2 -max 2 -randdist gaussian -stddev 0.7 -mean 1 -mutnrate 0.01 -strictmin yes -strictmax yes
-optim add number input.number(x2) -min -2 -max 2 -randdist gaussian -stddev 0.5 -mean 1 -mutnrate 0.01 -strictmin yes -strictmax yes
-#optim configure -operation minimize -popsize 50 -maxruns 100 -mutnrate 0.01 -crossovrate 0.9 -randnumseed 24 -stpcriteria toosimilar
+optim add number input.number(x1) -min -2 -max 2 -randdist uniform -strictmin yes -strictmax yes
+optim add number input.number(x2) -min -2 -max 2 -randdist uniform -strictmin yes -strictmax yes
+optim configure -operation minimize -popsize 200 -maxruns 100 -mutnrate 0.5 -crossovrate 0.8 -randnumseed 20 -stpcriteria toosimilar -mutnandcrossover no -allowdup no -numReplPerPop 50 -mutnValue 0.1
+optim get configure 
 
-optim get configure 
+set popsize 200  ;# size of each population for genetic algorithm
 
 set status [optim perform \
Index: /trunk/packages/optimizer/src/plugin_pgapack.c
===================================================================
--- /trunk/packages/optimizer/src/plugin_pgapack.c	(revision 1165)
+++ /trunk/packages/optimizer/src/plugin_pgapack.c	(revision 1166)
@@ -22,8 +22,12 @@
     int popSize;         /* population size <=> PGASetPopSize() */
     int popRepl;         /* replacement <=> PGASetPopReplacementType() */
+    int numReplPerPop;    /* number of new strings created per population, the rest are the best strings from the previous population*/
     int stpcriteria;     /*stoppage criteria <=> PGASetStoppingRuleType()*/
     int randnumseed;  /*Random Number Seed <=> PGASetRandomSeed()*/
     double mutnrate;     /*Mutation Rate <=> PGASetMutationProb()*/
+    double mutnValue;     /*use this value while mutating*/
     double crossovrate;  /*Crossover Rate <=> PGASetCrossoverProb();*/
+    int allowdup;        /*Allow duplicate strings in the population or not*/
+    int mutnandcrossover;/*By default strings that do not undergo crossover undergo mutation, this option allows strings to crossover and be mutated*/
 } PgapackData;
 
@@ -58,9 +62,13 @@
   {"-operation", &RpOption_Oper, Rp_Offset(PgapackData,operation)},
   {"-poprepl", &RpOption_PopRepl, Rp_Offset(PgapackData,popRepl)},
+  {"-numReplPerPop",RP_OPTION_INT,Rp_Offset(PgapackData,numReplPerPop)},
   {"-popsize", RP_OPTION_INT, Rp_Offset(PgapackData,popSize)},
   {"-mutnrate",RP_OPTION_DOUBLE,Rp_Offset(PgapackData,mutnrate)},
+  {"-mutnValue",RP_OPTION_DOUBLE,Rp_Offset(PgapackData,mutnValue)},
   {"-crossovrate",RP_OPTION_DOUBLE,Rp_Offset(PgapackData,crossovrate)},
   {"-randnumseed",RP_OPTION_INT,Rp_Offset(PgapackData,randnumseed)},
   {"-stpcriteria",&RpOption_StpCriteria,Rp_Offset(PgapackData,stpcriteria)},
+  {"-allowdup",RP_OPTION_BOOLEAN,Rp_Offset(PgapackData,allowdup)},
+  {"-mutnandcrossover",RP_OPTION_BOOLEAN,Rp_Offset(PgapackData,mutnandcrossover)},
   {NULL, NULL, 0}
 };
@@ -104,12 +112,17 @@
     dataPtr->popRepl = PGA_POPREPL_BEST;
     dataPtr->popSize = 200;
+    dataPtr->numReplPerPop = (dataPtr->popSize)/10; /*10% replaced by default, change to whatever value you need*/
     dataPtr->crossovrate = 0.85;
     dataPtr->mutnrate = 0.05; /*by default in PGAPack 1/stringlength*/
+    dataPtr->mutnValue = 0.01;/*value of this number will be changed by plus/minus hundredth of its current value*/
     dataPtr->randnumseed = 1; /*should be a number greater than one, PGAPack requires it*/
     dataPtr->stpcriteria = PGA_STOP_NOCHANGE;
+    dataPtr->allowdup = PGA_FALSE; /*Do not allow duplicate strings by default*/
+    dataPtr->mutnandcrossover = PGA_FALSE;/*do not allow mutation and crossover to take place on the same string by default*/
     return (ClientData)dataPtr;
 }
 
 int pgapack_abort = 0;
+int pgapack_restart_user_action = 0;
 
 /*
@@ -136,4 +149,5 @@
     pgapack_abort = 0;		/* FALSE */
     PGASetAbortVar(&pgapack_abort);
+    PGASetRestartUserAction(&pgapack_restart_user_action);
 
     ctx = PGACreate(&argc, argv, PGA_DATATYPE_USER, envPtr->numParams,
@@ -145,7 +159,11 @@
     PGASetStoppingRuleType(ctx, dataPtr->stpcriteria);
     PGASetMutationProb(ctx,dataPtr->mutnrate);
+    PGASetMutationRealValue(ctx,dataPtr->mutnValue);
     PGASetCrossoverProb(ctx,dataPtr->crossovrate);
     PGASetRandomSeed(ctx,dataPtr->randnumseed);
     PGASetCrossoverType(ctx, PGA_CROSSOVER_UNIFORM);
+    PGASetNoDuplicatesFlag(ctx,dataPtr->allowdup);
+    PGASetMutationAndCrossoverFlag(ctx,dataPtr->mutnandcrossover);
+    PGASetNumReplaceValue(ctx,dataPtr->numReplPerPop);
 
 
@@ -342,4 +360,5 @@
 
     int n, ival,tempmr;
+    double mutnVal;
     RpOptimEnv *envPtr;
     RpOptimParam *paramPtr;
@@ -358,6 +377,8 @@
                 if(numPtr->mutnrate!=PARAM_NUM_UNSPEC_MUTN_RATE){
                 	tempmr = numPtr->mutnrate;
+                	mutnVal = numPtr->mutnValue;
                 }else{
                 	tempmr = mr;
+                	mutnVal = PGAGetMutationRealValue(ctx);
                 }
                 if (PGARandomFlip(ctx, tempmr)) {
@@ -367,7 +388,7 @@
 	                /* bump the value up/down a little, randomly */
 	                if (PGARandomFlip(ctx, 0.5)) {
-	                    paramPtr[n].value.dval += 0.1*paramPtr[n].value.dval;
+	                    paramPtr[n].value.dval += mutnVal*paramPtr[n].value.dval; /*Made the mutation amount configurable*/
 	                } else {
-	                    paramPtr[n].value.dval -= 0.1*paramPtr[n].value.dval;
+	                    paramPtr[n].value.dval -= mutnVal*paramPtr[n].value.dval;
 	                }
 	                /* make sure the resulting value is still in bounds */
Index: /trunk/packages/optimizer/src/rp_optimizer.c
===================================================================
--- /trunk/packages/optimizer/src/rp_optimizer.c	(revision 1165)
+++ /trunk/packages/optimizer/src/rp_optimizer.c	(revision 1166)
@@ -115,4 +115,5 @@
     numPtr->max = DBL_MAX;
     numPtr->mutnrate = PARAM_NUM_UNSPEC_MUTN_RATE; /*Unspecified by default, should result in global mutn rate being applied*/
+    numPtr->mutnValue = 0.01; /* value of this number will be changed by plus/minus hundredth of its current value*/
     numPtr->randdist = RAND_NUMBER_DIST_GAUSSIAN ;/*Gaussian by default*/
     numPtr->stddev = 1; 
Index: /trunk/packages/optimizer/src/rp_optimizer.h
===================================================================
--- /trunk/packages/optimizer/src/rp_optimizer.h	(revision 1165)
+++ /trunk/packages/optimizer/src/rp_optimizer.h	(revision 1166)
@@ -48,5 +48,5 @@
  */
 typedef enum {
-    RP_OPTIM_SUCCESS=0, RP_OPTIM_UNKNOWN, RP_OPTIM_FAILURE, RP_OPTIM_ABORTED
+    RP_OPTIM_SUCCESS=0, RP_OPTIM_UNKNOWN, RP_OPTIM_FAILURE, RP_OPTIM_ABORTED, RP_OPTIM_RESTARTED
 } RpOptimStatus;
 
@@ -107,4 +107,5 @@
     double max;                     /* optimization constraint: max value */
     double mutnrate;            	/* independently sets mutation rate for each parameter*/
+    double mutnValue;               /* on mutation bumps up/down the value by val (+-) mutnValue*val */
     int randdist;             		/* gaussian or uniform distribution*/
     int strictmin;					/* whether a strict min is to be applied for gauss. rand. numbers*/
Index: /trunk/packages/optimizer/src/rp_optimizer_tcl.c
===================================================================
--- /trunk/packages/optimizer/src/rp_optimizer_tcl.c	(revision 1165)
+++ /trunk/packages/optimizer/src/rp_optimizer_tcl.c	(revision 1166)
@@ -17,4 +17,5 @@
 
 extern int pgapack_abort;
+extern int pgapack_restart_user_action;
 
 /*
@@ -57,4 +58,5 @@
   {"-max", RP_OPTION_DOUBLE, Rp_Offset(RpOptimParamNumber,max)},
   {"-mutnrate",RP_OPTION_DOUBLE, Rp_Offset(RpOptimParamNumber,mutnrate)},
+  {"-mutnValue",RP_OPTION_DOUBLE, Rp_Offset(RpOptimParamNumber,mutnValue)},
   {"-randdist",&RpOption_RandDist,Rp_Offset(RpOptimParamNumber,randdist)},
   {"-strictmin",RP_OPTION_BOOLEAN,Rp_Offset(RpOptimParamNumber,strictmin)},
@@ -83,5 +85,5 @@
 #endif
 
-extern int pgapack_abort;
+
 extern void PGARuntimeDataTableInit();
 extern void PGARuntimeDataTableDeInit();
@@ -394,5 +396,16 @@
 	pgapack_abort = value;
 	return TCL_OK;
-    } else if (*option == 'g' && strcmp(option,"get") == 0) {
+    }else if (*option == 'r' && strcmp(option,"restart") == 0){
+		int value;
+        if (objc < 3) {
+            Tcl_WrongNumArgs(interp, 1, objv, "restart bool");
+            return TCL_ERROR;
+        }
+		if (Tcl_GetBooleanFromObj(interp, objv[2], &value) != TCL_OK) {
+	    	return TCL_ERROR;
+		}
+		pgapack_restart_user_action = value;
+		return TCL_OK;    
+	}else if (*option == 'g' && strcmp(option,"get") == 0) {
 	/*
 	 * OPTION:  get ?globPattern? ?-option?
