-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
765 additions
and
2,979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
eclipse.preferences.version=1 | ||
filesCopiedToWebInfLib=gwt-servlet.jar | ||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+VFJBQ0U8L2xvZy1sZXZlbD48b3V0cHV0LXN0eWxlPk9CRlVTQ0FURUQ8L291dHB1dC1zdHlsZT48ZXh0cmEtYXJncz48IVtDREFUQVtdXT48L2V4dHJhLWFyZ3M+PHZtLWFyZ3M+PCFbQ0RBVEFbLVhteDUxMm1dXT48L3ZtLWFyZ3M+PGVudHJ5LXBvaW50LW1vZHVsZT5zdGFyLmdlbmV0aWNzLlN0YXJnZW5ldGljc19nd3RfamF2YTwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+ | ||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+REVCVUc8L2xvZy1sZXZlbD48b3V0cHV0LXN0eWxlPk9CRlVTQ0FURUQ8L291dHB1dC1zdHlsZT48ZXh0cmEtYXJncz48IVtDREFUQVtdXT48L2V4dHJhLWFyZ3M+PHZtLWFyZ3M+PCFbQ0RBVEFbLVhteDUxMm1dXT48L3ZtLWFyZ3M+PGVudHJ5LXBvaW50LW1vZHVsZT5zdGFyLmdlbmV0aWNzLlN0YXJnZW5ldGljc19nd3RfamF2YTwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/java/beans/JavaBeans.gwt.xml → src/star/genetics/beans/JavaBeans.gwt.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd"> | ||
<module> | ||
<inherits name="com.google.gwt.user.User" /> | ||
<!-- <inherits name="com.google.gwt.user.User" /> --> | ||
<source path=""/> | ||
</module> |
2 changes: 1 addition & 1 deletion
2
src/java/beans/PropertyChangeEvent.java → ...r/genetics/beans/PropertyChangeEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.beans; | ||
package star.genetics.beans; | ||
|
||
public class PropertyChangeEvent | ||
{ | ||
|
3 changes: 1 addition & 2 deletions
3
src/java/beans/PropertyChangeListener.java → ...enetics/beans/PropertyChangeListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package java.beans; | ||
package star.genetics.beans; | ||
|
||
public interface PropertyChangeListener | ||
{ | ||
public void propertyChange(PropertyChangeEvent e); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/java/beans/StringTokenizer.java → src/star/genetics/beans/StringTokenizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package java.beans; | ||
package star.genetics.beans; | ||
|
||
public class StringTokenizer | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package star.genetics.parser; | ||
|
||
import com.google.gwt.json.client.JSONNumber; | ||
import com.google.gwt.json.client.JSONObject; | ||
|
||
import star.genetics.genetic.impl.MatingEngineImpl_XY; | ||
import star.genetics.genetic.impl.ModelImpl; | ||
|
||
public class EngineParser | ||
{ | ||
public static void parse(ModelImpl model, JSONObject engine) | ||
{ | ||
String sex_type = engine.get("sex_type").isString().toString(); | ||
if ("xy".equalsIgnoreCase(sex_type)) | ||
{ | ||
parse_XY(model, engine); | ||
} | ||
} | ||
|
||
private static float get(JSONObject obj, String key, float default_value) | ||
{ | ||
float ret = default_value; | ||
if (obj.containsKey(key)) | ||
{ | ||
JSONNumber n = obj.get(key).isNumber(); | ||
if (n != null) | ||
{ | ||
ret = (float) n.doubleValue(); | ||
} | ||
} | ||
return ret; | ||
} | ||
|
||
private static void parse_XY(ModelImpl model, JSONObject engine) | ||
{ | ||
float maleRecombinationRate = get(engine, "male_recombination_rate", 1.0f); | ||
float femaleRecombinationRate = get(engine, "female_recombination_rate", 1.0f); | ||
float femaleSexRatio = get(engine, "female_sex_ratio", 1.0f); | ||
int progeniesCount = Math.round(get(engine, "avg_offspring_count", 50.0f)); | ||
float twinningFrequency = get(engine, "twinning", 0.0f); | ||
float identicalTwinsFrequency = get(engine, "identical_twins_frequency", 0.0f); | ||
|
||
MatingEngineImpl_XY xy = new MatingEngineImpl_XY(maleRecombinationRate, femaleRecombinationRate, femaleSexRatio, progeniesCount, twinningFrequency, identicalTwinsFrequency); | ||
model.setMater(xy); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package star.genetics.parser; | ||
|
||
import star.genetics.genetic.impl.AlleleImpl; | ||
import star.genetics.genetic.impl.ChromosomeImpl; | ||
import star.genetics.genetic.impl.GeneImpl; | ||
import star.genetics.genetic.impl.GenomeImpl; | ||
import star.genetics.genetic.impl.ModelImpl; | ||
|
||
import com.google.gwt.json.client.JSONArray; | ||
import com.google.gwt.json.client.JSONObject; | ||
|
||
public class GenomeParser | ||
{ | ||
|
||
public static void parse(ModelImpl model, JSONObject genome) | ||
{ | ||
GenomeImpl ret = new GenomeImpl(); | ||
parseChromosomes( ret , genome.get("chromosomes").isObject()); | ||
model.setGenome(ret); | ||
} | ||
|
||
|
||
private static void parseChromosomes(GenomeImpl genome, JSONObject chromosomes) | ||
{ | ||
for( String chromosome_id : chromosomes.keySet() ) { | ||
ChromosomeImpl c = new ChromosomeImpl(chromosome_id, genome); | ||
parseChromosome( c, chromosomes.get(chromosome_id).isObject() ); | ||
} | ||
} | ||
|
||
|
||
private static void parseChromosome(ChromosomeImpl c, JSONObject chromosome) | ||
{ | ||
String name = chromosome.get("name").isString().toString(); | ||
parseGenes( c , chromosome.get("genes").isArray()); | ||
} | ||
|
||
|
||
private static void parseGenes(ChromosomeImpl c, JSONArray genes) | ||
{ | ||
for( int i = 0 ; i < genes.size() ; i++) | ||
{ | ||
JSONObject gene = genes.get(i).isObject(); | ||
parseGene( c , gene ); | ||
} | ||
|
||
} | ||
|
||
|
||
private static void parseGene(ChromosomeImpl c, JSONObject gene) | ||
{ | ||
String name = gene.get("name").isString().toString(); | ||
float position = (float)gene.get("position").isNumber().doubleValue(); | ||
GeneImpl g = new GeneImpl(name, position, c); | ||
parseAlleles( g , gene.get("alleles").isArray()); | ||
} | ||
|
||
|
||
private static void parseAlleles(GeneImpl gene, JSONArray alleles) | ||
{ | ||
for( int i = 0 ; i < alleles.size() ; i++ ) | ||
{ | ||
parseAllele( gene , alleles.get(i).isObject()); | ||
} | ||
} | ||
|
||
|
||
private static void parseAllele(GeneImpl gene, JSONObject allele) | ||
{ | ||
String name = allele.get("name").isString().toString(); | ||
AlleleImpl a = new AlleleImpl(name, gene); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.