/**
 * 
 */
package pacemaker;

import peersim.core.CommonState;

/**
 * Holds data from real species of fireflies, as found in literature.<p>
 * 
 * Values of period, pulse, ecc are collected in a static field 
 * "{@link #data}" for immediate use by other classes.
 * 
 * @author Tony Binci
 */
public class Species {

	/** 
	 * Real Data from firefly species.<p>
	 * 
	 * Legend: SPECIES_NAME, period, pulse_duration, prep, inert, model, b, epsilon, max_period, min_period, relaxation<p>
	 *
	 * Times are in millisecs.<p>
	 * <code>null</code> is used when a certain value in unknown.<p>
	 */
	public static final String data [][] = {
		{"DEFAULT",			"1000000", "50000", "80000", "200000", "ADAPTIVE", "1", "0.3", "1150000", "850000", "0.01"}, // a default n-uple for secure values
		
		// total sync species
		{"MALACCAE_MALAY",	"900000", "50000", null, null, "ADAPTIVE", "1", "0.3", "1030000", "770000", null}, //hanson 1978+Ermentrout 1991+Buck 1988+Mirollo,Strogatz 1990+Buck and Buck 1978
		{"MALACCAE_MALAY_2","850000", "50000", null, null, "ADAPTIVE", "1", "0.3", null, null, null}, //Ermentrout 1991+Buck 1988+Mirollo,Strogatz 1990+Buck and Buck 1978		
		{"MALACCAE_3",		"600000", "50000", null, null, "ADAPTIVE", "1", "0.3", "600000", "500000", null}, //Carlson,Copeland 1985+Ermentrout 1991+Mirollo,Strogatz 1990++Buck and Buck 1978
		{"MALACCAE_THAI",	"560000", "50000", "70000", "70000", "ADAPTIVE", "1", "0.3", "672000", "448000", "0.01"}, //Kim 2004+Ermentrout 1991+Copeland,Moiseff 2004+Buck 1988+Buck 1968+Buck&Buck1968+Mirollo,Strogatz 1990++Buck and Buck 1978+Hanson,Case,Buck,Buck 1971
		{"CRIBELLATA",		"1000000", "50", null, "200", "DELAY", "1", null, "1600000", "800000", null}, //hanson 1978+Carlson,Copeland 1985+Kim2004+Ermentrout 1991+Buck 1988+Mirollo,Strogatz 1990+Hanson,Case,Buck,Buck 1971
		{"CRIBELLATA_2",	"1000000", "50", null, "450", "DELAY", "1", null, null, null, null}, //Buck and Buck 1978+Carlson,Copeland 1985+Kim2004+Ermentrout 1991+Buck 1988+Mirollo,Strogatz 1990
		{"CRIBELLATA_3",	"5000000", "50", null, null, "DELAY", "1", null, null, null, null}, //Buck and Buck 1978+Carlson,Copeland 1985+Kim2004+Ermentrout 1991+Buck 1988+Mirollo,Strogatz 1990+Buck and Buck 1978		
		{"PUPILLA",			"1000000",	"50", null, null, "MAS", "1", "0.3", "1100000", "800000", null}, //hanson 1978+Ermentrout 1991+Buck and Buck 1978
		{"TENER",			"270000", null, null, null, "MAS", "1", "0.3", null, null, null}, //Carlson,Copeland 1985+Ermentrout 1991
		{"TENER_2",			"300000", null, null, null, "MAS", "1", "0.3", null, null, null}, //Buck and Buck 1978+Ermentrout 1991
		{"TENER_3",			"2000000", null, null, null, "MAS", "1", "0.3", null, null, null}, //Ermentrout 1991+Copeland,Moiseff 1997		
		
		// imprecise sync (including: intermittent sync, wave sync, only-2-sync, follow-the-leader)
		//intermittent
		{"PYRALIS",			"6000000", "600000", "200000", "200000", "ADVANCE", "0", null, null, null, null}, //Carlson,Copeland 1985+Kim2004+Ermentrout 1991+Buck 1988+Mirollo,Strogatz 1990		
		//only-2
		{"FRONTALIS",		"900000", "27000", null, null, null, null, null, "970000", "800000", null}, //Moiseff,Copeland 2000+Copeland,Moiseff 2004
		//wave
		{"GREENI",			"1200000", null, null, null, "DELAY", null, null, null, null, null}, //Carlson,Copeland 1985+Buck 1988+Tyler 2003
		{"GREENI_2",		"5000000", "150000", null, null, "DELAY", null, null, null, null, null}, //Lewis,Cratsley,Demary 2004+Buck 1988+Tyler 2003
		{"MACDERMOTTI",		"2300000", null, null, null, "DELAY", null, null, null, null, null}, //Carlson,Copeland 1985+Buck 1988+Tyler 2003
		{"MACDERMOTTI_2",	"2000000", null, null, null, "DELAY", null, null, null, "1625000", null}, //Buck 1988+Tyler 2003
		{"MACDERMOTTI_3",	"6000000", "177000", null, null, "DELAY", null, null, null, null, null}, //Lewis,Cratsley,Demary 2004+Buck 1988+Tyler 2003
		{"CONSANGUINEOUS",	"5082000", "200000", null, null, "DELAY", null, null, null, null, null}, // Buck1988+Lewis,Cratsley,Demary 2004+Tyler 2003
		//sporadic
		{"VERSICOLOR",		"240000", "100000", null, null, null, null, null, null, null, null}, //Carlson,Copeland 1985
		{"VALIDA",			"33000", null, null, null, null, null, null, null, null, null}, // Buck 1988+Buck and Buck 1978
		{"CONCISUS",		null, null, null, null, "ADVANCE", null, null, null, null, null}, //Buck1988+Moiseff,Copeland 2000+Otte 1980
		{"KNULLI",			null, null, null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		{"CAROLINUS",		"12000000", "200000", null, "4000000", null, null, null, null, null, null}, //Copeland,Moiseff 1995+Lewis,Cratsley,Demary 2004

		// absolute no sync
		{"CRUCIATA",		null, null, null,null,  null, "1", null, null, null, null}, //Buck 1988
		{"CONSIMILIS",		"3300000", "70000", null, "236000", "ADVANCE", null, null, null, null, null}, // branham,greenfield 1996
		{"PALLENS",			null, null, null, null, null, null, null, null, null, null}, //Buck and Buck 1978
		{"MARGINELLUS",		"2800000", "400000", null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		{"SABULOSUS",		"3800000", "177000", null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		{"PYRALIS_2",		"5600000", "700000", null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		{"UMBRATUS",		"6700000", "500000", null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		{"COLLUSTRANS",		"2200000", "384000", null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		{"IGNITUS",			"5000000", "300000", null, null, null, null, null, null, null, null}, //Lewis,Cratsley,Demary 2004
		
		//Lewis,Cratsley,Demary 2004 imprecision +/- 30msec
//		{"NAME", "p", "f", "pre", "i", "m", "b", "e", "max", "min", "relax"},
		
	};
	
	/** 
	 * Next static Strings explicits the corripondence between<p> 
	 * column name == array index <p>
	 * for the previous {@link #data} table.  
	 */
 	public static int NAME = 0;
 	public static int PERIOD = 1;
 	public static int PULSE_DURATION = 2;
 	public static int PREP = 3;
 	public static int INERT = 4;
 	public static int MODEL = 5;
 	public static int B = 6;
 	public static int EPSILON = 7;
 	public static int MAX = 8;
 	public static int MIN = 9;
 	public static int RELAXATION = 10;
 	
	public static void main(String[] args) {
		System.out.println("Testing Species.java...");
		Number max = new Long(1150000); 
		long d = max.longValue();
		System.out.println("d= "+d+" nextLong="+CommonState.r.nextLong(d));
	}
}
