public class growth
{
    public static void main (String[] args)
    {
	/*
	 * y = a(1+r)^x
	 */

	double y = 0;
	double a = 1; // initial value
	double r = 0.3; // infection rate
	int x = 0;
	int t = 100;
	int p = 0;
	double mingle = 0.0; // a fudge factor to represent population mingling or not
	double isolate = 0.0; // a fudge factor to represent population that isolates

	for (int i = 0; i < args.length; i++)
        {
	    if ("-help".equals(args[i]))
	    {
		System.out.println("growth [-infection <value>] [-time <value>] [-population <value>] [-mingle <value>] [-isolate <value>] [-help]");
		System.exit(0);
	    }

	    /**
	     * The act of mingling increases the chance of cross pollination
	     * of the infection, i.e., it increases the infection rate.
	     */

	    if ("-mingle".equals(args[i]))
	    {
		Double m = Double.parseDouble(args[i+1]);

		mingle = m.doubleValue();
	    }

	    /**
	     * The act of isolating reduces the changes of cross pollination.
	     */

	    if ("-isolate".equals(args[i]))
	    {
		Double iso = Double.parseDouble(args[i+1]);

		isolate = iso.doubleValue();
	    }

	    if ("-population".equals(args[i]))
	    {
		Integer pop = Integer.parseInt(args[i+1]);

		p = pop.intValue();
	    }
	    
	    if ("-infection".equals(args[i]))
	    {
		Double inf = Double.parseDouble(args[i+1]);

		r = inf.doubleValue();
	    }

	    if ("-time".equals(args[i]))
	    {
		Integer time = Integer.parseInt(args[i+1]);

		t = time.intValue();
	    }
	}

	/**
	 * What do we do with mingle and isolate? Since they both affect the infection rate
	 * we'll have different algorithms:
	 *
	 * (i) a simple alogorithm of adding mingle and subtracting isolate.
	 * (ii)
	 */

	r = r + mingle - isolate;

	System.out.println("Time: 0\nInfected: "+a);

	for (int i = 1; i < t; i++)
	{
	    System.out.println("Time: "+i);

	    y = a * (1+r);
	    
	    System.out.println("Infected: "+y);

	    a = y;

	    if (p != 0)
	    {
		if (a > p)
		{
		    System.out.println("It took "+i+" iterations to saturate the population");
		    System.exit(0);
		}
	    }
	}
    }
}

@@ -370,16 +370,252 @@
 isolates
+%0A%09int algorithm = 1;%0A%0A%09/**%0A%09 * What do we do with mingle and isolate? Since they both affect the infection rate%0A%09 * we'll have different algorithms:%0A%09 *%0A%09 * (i) a simple alogorithm of adding mingle and subtracting isolate.%0A%09 * (ii)%0A%09 */
 %0A%0A%09for (
@@ -822,16 +822,32 @@
 %3Cvalue%3E%5D
+ %3C-algo %3Cvalue%3E%5D
  %5B-help%5D
@@ -1495,16 +1495,139 @@
 ;%0A%09    %7D
+%0A%0A%09    if (%22-algo%22.equals(args%5Bi%5D))%0A%09    %7B%0A%09%09Integer a = Integer.parseInt(args%5Bi+1%5D);%0A%0A%09%09algorithm = pop.intValue();%0A%09    %7D
 %0A%09    %0A%09

Update growth.java