-
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.
[biosilico][ants][anthill] work on biosilio, common & crypto
- Loading branch information
Showing
38 changed files
with
2,492 additions
and
136 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
42 changes: 42 additions & 0 deletions
42
biosilico-biosilico/src/main/java/gabywald/biosilico/anthill/Ant.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package gabywald.biosilico.anthill; | ||
|
||
import gabywald.biosilico.model.Organism; | ||
|
||
/** | ||
* | ||
* @author Gabriel Chandesris (2009, 2020) | ||
*/ | ||
public class Ant extends Organism { | ||
|
||
public enum AntStatus { | ||
EGG_LARVA, // (0, 1), | ||
WORKER, // (2, 3, 4, 5, 6, 7), | ||
SOLDIER, // (8), | ||
QUEEN; // (9); | ||
} | ||
/** | ||
* Status of ant. | ||
* <p></p> | ||
* <ul> | ||
* <li><b>0-1</b> : Egg / Larva</li> | ||
* <li><b>2-7</b> : Worker</li> | ||
* <li><b>8</b> : Soldier</li> | ||
* <li><b>9</b> : Queen</li> | ||
* </ul> | ||
*/ | ||
private int status; | ||
|
||
/** Default constructor of an Ant agent (alive). */ | ||
public Ant() { | ||
super(); | ||
this.setAlive( true ); | ||
this.setEatable( false ); | ||
this.setMovable( false ); | ||
|
||
this.setNameCommon("Ant"); | ||
this.setOrganismType(OrganismType.BIOSILICO_ANIMA); | ||
|
||
this.status = 0; /** start with an egg. */ | ||
} | ||
|
||
} |
85 changes: 85 additions & 0 deletions
85
biosilico-biosilico/src/main/java/gabywald/biosilico/anthill/AntBuilder.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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package gabywald.biosilico.anthill; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import gabywald.biosilico.genetics.Gene; | ||
import gabywald.biosilico.genetics.builders.BiochemicalReactionBuilder; | ||
|
||
/** | ||
* | ||
* @author Gabriel Chandesris (2020) | ||
*/ | ||
public class AntBuilder { | ||
|
||
public AntBuilder() { | ||
; | ||
} | ||
|
||
public List<Gene> generateBasicGenome() { | ||
List<Gene> toReturn = new ArrayList<Gene>(); | ||
|
||
// NOTEs :: | ||
// // // need some initial concentration !! | ||
// // // need some biochemical reaction | ||
// // // receptor for some variables from environment | ||
// // // emitter for some variables from environment | ||
// // // Decision to take fruits ! | ||
// // // Decision to drop fruits ! (in the AntHill) | ||
// // // Decision to eat fruits ! | ||
// // // Decision to display pheromones ! | ||
|
||
// // // detection of pheromones ! | ||
// // // choice of destination :: movement !! | ||
|
||
|
||
BiochemicalReactionBuilder brb = new BiochemicalReactionBuilder(); | ||
toReturn.add(brb.achem( 20 ).acoef( 1 ) | ||
.bchem( 21 ).bcoef( 1 ) | ||
.cchem( 22 ).ccoef( 1 ) | ||
.dchem( 23 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 22 ).acoef( 1 ) | ||
.bchem( 23 ).bcoef( 1 ) | ||
.cchem( 24 ).ccoef( 1 ) | ||
.dchem( 25 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 24 ).acoef( 1 ) | ||
.bchem( 25 ).bcoef( 1 ) | ||
.cchem( 26 ).ccoef( 1 ) | ||
.dchem( 27 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 26 ).acoef( 1 ) | ||
.bchem( 27 ).bcoef( 1 ) | ||
.cchem( 28 ).ccoef( 1 ) | ||
.dchem( 29 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 28 ).acoef( 1 ) | ||
.bchem( 29 ).bcoef( 1 ) | ||
.cchem( 30 ).ccoef( 1 ) | ||
.dchem( 31 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 30 ).acoef( 1 ) | ||
.bchem( 31 ).bcoef( 1 ) | ||
.cchem( 32 ).ccoef( 1 ) | ||
.dchem( 33 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 32 ).acoef( 1 ) | ||
.bchem( 33 ).bcoef( 1 ) | ||
.cchem( 34 ).ccoef( 1 ) | ||
.dchem( 35 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 34 ).acoef( 1 ) | ||
.bchem( 35 ).bcoef( 1 ) | ||
.cchem( 36 ).ccoef( 1 ) | ||
.dchem( 37 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
return toReturn; | ||
} | ||
|
||
public Ant build() { | ||
|
||
return null; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
biosilico-biosilico/src/main/java/gabywald/biosilico/anthill/Fruit.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package gabywald.biosilico.anthill; | ||
|
||
import gabywald.biosilico.model.Chemicals; | ||
import gabywald.biosilico.model.Organism; | ||
|
||
/** | ||
* This class defines a specific element which is not alive but can be move and eat by agents in the system. | ||
* <br />Produced by plants, do not do anything either. | ||
* @author Gabriel Chandesris (2009, 2020) | ||
*/ | ||
public class Fruit extends Organism { | ||
|
||
/** | ||
* Default constructor for Fruit. | ||
*/ | ||
public Fruit() { | ||
super(); | ||
this.setAlive( false ); | ||
this.setEatable( true ); | ||
this.setMovable( true ); | ||
|
||
this.setNameCommon("Fruit"); | ||
this.setOrganismType(OrganismType.BIOSILICO_VIRIDITA); | ||
} | ||
|
||
/** | ||
* Constructor of a Fruit which have only one variable to feed. | ||
* @param var (int) | ||
* @param val (int) | ||
* @see Chemicals#setVarPlus(int, int) | ||
*/ | ||
public Fruit(int var, int val) { | ||
this(); | ||
this.variables.setVarPlus(var, val); | ||
} | ||
|
||
/** | ||
* Constructor with pre-established Variables set. | ||
* @param toFeed (Chemicals) | ||
*/ | ||
public Fruit(Chemicals toFeed) { | ||
this(); | ||
this.variables = toFeed; | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
biosilico-biosilico/src/main/java/gabywald/biosilico/anthill/Plant.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package gabywald.biosilico.anthill; | ||
|
||
import gabywald.biosilico.model.Organism; | ||
|
||
/** | ||
* This class describes plants which produce fruits. | ||
* @author Gabriel Chandesris (2009, 2020) | ||
* @see Fruit | ||
*/ | ||
public class Plant extends Organism { | ||
|
||
/** Default Constructor. */ | ||
public Plant() { | ||
super(); | ||
this.setAlive( true ); | ||
this.setEatable( false ); | ||
this.setMovable( false ); | ||
|
||
this.setNameCommon("Plant"); | ||
this.setOrganismType(OrganismType.BIOSILICO_VIRIDITA); | ||
|
||
// ***** Here creation of 'egg' => create fruits ! | ||
|
||
} | ||
|
||
} |
131 changes: 131 additions & 0 deletions
131
biosilico-biosilico/src/main/java/gabywald/biosilico/anthill/PlantBuilder.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 |
---|---|---|
@@ -0,0 +1,131 @@ | ||
package gabywald.biosilico.anthill; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import gabywald.biosilico.genetics.Gene; | ||
import gabywald.biosilico.genetics.builders.BiochemicalReactionBuilder; | ||
import gabywald.biosilico.genetics.builders.InitialConcentrationBuilder; | ||
|
||
/** | ||
* | ||
* @author Gabriel Chandesris (2020) | ||
*/ | ||
public class PlantBuilder { | ||
|
||
public PlantBuilder() { | ||
; | ||
} | ||
|
||
public List<Gene> generateBasicGenome() { | ||
List<Gene> toReturn = new ArrayList<Gene>(); | ||
|
||
// NOTEs :: | ||
// // // need some initial concentration !! | ||
// // // need some biochemical reaction | ||
// // // receptor for some variables from environment | ||
// // // emitter for some variables from environment | ||
// // // Decision to make fruits ! | ||
|
||
InitialConcentrationBuilder icb = new InitialConcentrationBuilder(); | ||
toReturn.add( icb.varia( 0 ).value( 100 ).agemin( 0 ).agemax( 0 ).mutation(25).build() ); | ||
|
||
BiochemicalReactionBuilder brb = new BiochemicalReactionBuilder(); | ||
toReturn.add(brb.achem( 0 ).acoef( 1 ) | ||
.bchem( 1 ).bcoef( 1 ) | ||
.cchem( 2 ).ccoef( 1 ) | ||
.dchem( 3 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 2 ).acoef( 1 ) | ||
.bchem( 3 ).bcoef( 1 ) | ||
.cchem( 4 ).ccoef( 1 ) | ||
.dchem( 5 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 4 ).acoef( 1 ) | ||
.bchem( 5 ).bcoef( 1 ) | ||
.cchem( 6 ).ccoef( 1 ) | ||
.dchem( 7 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 6 ).acoef( 1 ) | ||
.bchem( 7 ).bcoef( 1 ) | ||
.cchem( 8 ).ccoef( 1 ) | ||
.dchem( 9 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 8 ).acoef( 1 ) | ||
.bchem( 9 ).bcoef( 1 ) | ||
.cchem( 10 ).ccoef( 1 ) | ||
.dchem( 11 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 10 ).acoef( 1 ) | ||
.bchem( 11 ).bcoef( 1 ) | ||
.cchem( 12 ).ccoef( 1 ) | ||
.dchem( 13 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 12 ).acoef( 1 ) | ||
.bchem( 13 ).bcoef( 1 ) | ||
.cchem( 14 ).ccoef( 1 ) | ||
.dchem( 15 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 14 ).acoef( 1 ) | ||
.bchem( 15 ).bcoef( 1 ) | ||
.cchem( 16 ).ccoef( 1 ) | ||
.dchem( 17 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 16 ).acoef( 1 ) | ||
.bchem( 17 ).bcoef( 1 ) | ||
.cchem( 18 ).ccoef( 1 ) | ||
.dchem( 19 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 18 ).acoef( 1 ) | ||
.bchem( 19 ).bcoef( 1 ) | ||
.cchem( 20 ).ccoef( 1 ) | ||
.dchem( 21 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 20 ).acoef( 1 ) | ||
.bchem( 21 ).bcoef( 1 ) | ||
.cchem( 22 ).ccoef( 1 ) | ||
.dchem( 23 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 22 ).acoef( 1 ) | ||
.bchem( 23 ).bcoef( 1 ) | ||
.cchem( 24 ).ccoef( 1 ) | ||
.dchem( 25 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 24 ).acoef( 1 ) | ||
.bchem( 25 ).bcoef( 1 ) | ||
.cchem( 26 ).ccoef( 1 ) | ||
.dchem( 27 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 26 ).acoef( 1 ) | ||
.bchem( 27 ).bcoef( 1 ) | ||
.cchem( 28 ).ccoef( 1 ) | ||
.dchem( 29 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 28 ).acoef( 1 ) | ||
.bchem( 29 ).bcoef( 1 ) | ||
.cchem( 30 ).ccoef( 1 ) | ||
.dchem( 31 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 30 ).acoef( 1 ) | ||
.bchem( 31 ).bcoef( 1 ) | ||
.cchem( 32 ).ccoef( 1 ) | ||
.dchem( 33 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 32 ).acoef( 1 ) | ||
.bchem( 33 ).bcoef( 1 ) | ||
.cchem( 34 ).ccoef( 1 ) | ||
.dchem( 35 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
toReturn.add(brb.achem( 34 ).acoef( 1 ) | ||
.bchem( 35 ).bcoef( 1 ) | ||
.cchem( 36 ).ccoef( 1 ) | ||
.dchem( 37 ).dcoef( 1 ) | ||
.kmvm( 5 ).agemax(999).mutation(25).build()); | ||
return toReturn; | ||
} | ||
|
||
public Plant build() { | ||
|
||
return null; | ||
} | ||
} |
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
Oops, something went wrong.