SlideShare a Scribd company logo
1 of 18
Download to read offline
Introduction Nursery Main Nursery Genotype Summary References
EVOLUTIONARY NURSEY
THE SOURCE CODE
Muhammad Adil Raja
Roaming Researchers, Inc.
cbna
April 27, 2015
Introduction Nursery Main Nursery Genotype Summary References
OUTLINE I
1 INTRODUCTION
2 NURSERY MAIN
3 NURSERY
4 GENOTYPE
5 SUMMARY
6 REFERENCES
Introduction Nursery Main Nursery Genotype Summary References
INTRODUCTION
Evolutionary nursery is an implementation of a simple
genetic algorithm (GA).
The algorithm is implemented in Java.
The algorithm is aimed at numerical optimization problems.
The source code has three main Java files.
1 NurseryMain.java: The main entry point to the program that
runs the genetic algorithm.
2 Nursery.java: This class implements the algorithms that are
necessary to run the GA, such as crossover and mutation.
3 Genotype.java: The data-type Genotype specifies the
implementation of the GA genotype.
In what follows you will find the source code of various
components of evolutionary nursery.
Introduction Nursery Main Nursery Genotype Summary References
NURSERY MAIN I
/∗
∗ NurseryMain . java
∗
∗ Created on September 3 , 2007, 8:52 PM
∗
∗ To change t h i s template , choose Tools | Template Manager
∗ and open the template in the e d i t o r .
∗/
package EvoNursery ;
/∗∗
∗
∗ @author a d i l r a j a
∗/
import java . u t i l . ∗ ;
public class NurseryMain {
/∗∗ Creates a new instance of NurseryMain ∗/
public NurseryMain ( ) {
}
/∗∗
∗ @param args the command l i n e arguments
∗/
public static void main ( String [ ] args ) {
/ / TODO code a p p l i c a t i o n l o g i c here
double Fitness =90;
double [ ] bestGene=new double [ 2 ] ;
Introduction Nursery Main Nursery Genotype Summary References
NURSERY MAIN II
Nursery nurse=new Nursery ( ) ;
ArrayList <Genotype> pop=nurse . i n i t i a l i z e P o p u l a t i o n (300 , 2 , −6, +6); / / should i n i t i a l i z e
int numGens=15;
while ( true ) {
for ( int i =0; i <numGens; i ++){
ArrayList <Genotype> childPop=nurse . applySelectionTournament ( pop , 4 ) ;
nurse . applySinglePointCrossover ( childPop , 2 , 0 . 8 ) ;
nurse . applyMutationUniform ( childPop , 2 , 0 . 2 ) ;
pop . addAll ( childPop ) ; / / append the two pops here
for ( int j =0; j <pop . size ( ) ; j ++){
double [ ] tmpGenes=pop . get ( j ) . getGenotype ( ) ;
double f i t n e s s =10∗2+tmpGenes [0]∗ tmpGenes[0]−10∗ java . lang . Math . cos(2∗3.141∗tmpG
+tmpGenes [1]∗ tmpGenes[1]−10∗ java . lang . Math . cos(2∗3.141∗tmpGenes [ 1 ] ) ;
pop . get ( j ) . setFitness ( f i t n e s s ) ;
i f ( fitness <Fitness ) {
Fitness= f i t n e s s ;
bestGene [0]= tmpGenes [ 0 ] ;
bestGene [1]= tmpGenes [ 1 ] ;
}
nurse . applySurvival ( pop ) ;
}
}
System . out . p r i n t l n ( Fitness+" "+bestGene [0]+ " "+bestGene [ 1 ] ) ;
}
}
}
Introduction Nursery Main Nursery Genotype Summary References
NURSERY I
/∗
∗ Nursery . java
∗
∗ Created on September 3 , 2007, 5:35 PM
∗
∗ To change t h i s template , choose Tools | Template Manager
∗ and open the template in the e d i t o r .
∗t h i s i s the f i l e where evolution would occur
∗/
package EvoNursery ;
/∗∗
∗
∗ @author a d i l r a j a
∗/
import java . u t i l . ∗ ;
public class Nursery {
/∗∗
∗
∗ Creates a new instance of Nursery
∗ I n i t i a l i z e s a population
∗ popSize−population size
∗ numCoeffs−− to be tuned
∗ upperBound −− The upper bound of a number
∗ lower Bound −− The lower bound of a coeff
∗/
Introduction Nursery Main Nursery Genotype Summary References
NURSERY II
private Random dice ;
private ArrayList <Integer > lMateVector ;
private double span ;
private double lowerBound ;
private int parentPopSize ;
public Nursery ( ) {
dice=new Random ( ) ; / /We need a Random number generator
this . lMateVector=new ArrayList ( ) ;
}
/∗∗
∗ I n i t i a l i z e a population
∗/
public ArrayList <Genotype> i n i t i a l i z e P o p u l a t i o n ( int popSize , int numCoeffs , double upperBo
ArrayList <Genotype> population=new ArrayList ( popSize ) ; / / creates an empty l i s t with t h i
/ / The elements would be added manually
this . span=upperBound−lowerBound ;
this . lowerBound=lowerBound ;
this . parentPopSize=popSize ;
double [ ] tmpGenotype=new double [ numCoeffs ] ;
for ( int j =0; j <popSize ; j ++){
for ( int i =0; i <numCoeffs ; i ++){
tmpGenotype [ i ]= dice . nextDouble ()∗ span+lowerBound ;
}
population . add (new Genotype ( tmpGenotype ) ) ;
Introduction Nursery Main Nursery Genotype Summary References
NURSERY III
}
return population ;
}
/∗∗
∗Puppy Style tournamentSelection
∗/
public ArrayList <Genotype> applySelectionTournament ( ArrayList <Genotype> ioPopulation , int inN
{
i f ( ioPopulation . size ( ) == 0) return null ;
ArrayList <Genotype> childPop=new ArrayList ( ioPopulation . size ( ) ) ;
/ / choose the f i r s t candidate and store in the c h i l d population
while ( childPop . size () <= ioPopulation . size ( ) ) {
int j j =0;
int lChosenCand1=0 , lChosenCand2=0;
int tmpCand1=ioPopulation . size ()+1 , tmpCand2=ioPopulation . size ( ) + 1 ;
while ( j j <inNumberParticipants ) {
lChosenCand1=dice . nextInt ( ioPopulation . size ( ) ) ;
i f ( tmpCand1<ioPopulation . size ( ) ) {
i f ( ioPopulation . get ( lChosenCand1 ) . getFitness () < ioPopulation . get ( tmpCand1 ) . getFitness
tmpCand1=lChosenCand1 ; / / choose an i n d i v i d u a l ,
}
}
else
tmpCand1=lChosenCand1 ; / / choose t h i s
j j ++;
}
Introduction Nursery Main Nursery Genotype Summary References
NURSERY IV
childPop . add (new Genotype ( ioPopulation . get ( tmpCand1 ) ) ) ; / / Add t h i s to the c h i l d population
/ / choose the second candidate now and store in the c h i l d population
j j =0;
while ( j j <inNumberParticipants ) {
lChosenCand2=dice . nextInt ( ioPopulation . size ( ) ) ;
i f ( tmpCand2<=ioPopulation . size ( ) ) { / / implements Gustafson and LPP
i f ( ioPopulation . get ( lChosenCand2 ) . getFitness () < ioPopulation . get ( tmpCand2 ) . getFitness
{
tmpCand2=lChosenCand2 ; / / choose an i n d i v i d u a l ,
}
}
else
tmpCand2=lChosenCand2 ; / / choose t h i s
j j ++;
}
childPop . add (new Genotype ( ioPopulation . get ( tmpCand2 ) ) ) ; / / Add t h i s to the c h i l d population
}
return childPop ;
}
/∗∗
∗Apply single−point crossover
∗/
public void applySinglePointCrossover ( ArrayList <Genotype> ioPopulation , int genomeLength , dou
i f ( ( ioPopulation . size ( ) % 2) != 0) ioPopulation . remove ( lMateVector . size () −1);
Introduction Nursery Main Nursery Genotype Summary References
NURSERY V
for ( int j =0; j <ioPopulation . size ( ) ; j +=2) {
double [ ] tmpParent1=ioPopulation . get ( j ) . getGenotype ( ) ;
double [ ] tmpParent2=ioPopulation . get ( j +1). getGenotype ( ) ;
double swapGene ;
int XoverPoint=dice . nextInt ( genomeLength ) ;
i f ( genomeLength==2 && XoverPoint ==0) XoverPoint =1; / / The special case when genome length i s
for ( int i =0; i <XoverPoint ; i ++){
swapGene=tmpParent1 [ i ] ;
tmpParent1 [ i ]= tmpParent2 [ i ] ;
tmpParent2 [ i ]=swapGene ; / / xover i s no big deal
}
ioPopulation . get ( j ) . setEvaluated ( false ) ;
ioPopulation . get ( j +1). setEvaluated ( false ) ;
}
}
/∗∗
∗Applies standard mutation to the population . The numbers are drawn from a uniform d i s t r i b u t a
∗/
public void applyMutationUniform ( ArrayList <Genotype> ioPopulation , int genomeLength , double mu
I t e r a t o r <Genotype> genoIt=ioPopulation . i t e r a t o r ( ) ;
while ( genoIt . hasNext ( ) ) {
boolean f l a g =false ;
Genotype genome=genoIt . next ( ) ;
double [ ] tmpParent=genome . getGenotype ( ) ;
Introduction Nursery Main Nursery Genotype Summary References
NURSERY VI
for ( int i =0; i <genomeLength ; i ++){
i f ( dice . nextDouble () <= mutationProb ) {
tmpParent [ i ]= dice . nextDouble ()∗ this . span+this . lowerBound ;
f l a g =true ;
}
}
i f ( f l a g )
genome . setEvaluated ( false ) ;
}
}
/∗∗
∗an e l i t i s t s u r v i v a l c r i t e r i o n
∗/
public void applySurvival ( ArrayList <Genotype> ioPopulation ) {
Collections . sort ( ioPopulation , new FitnessComparator ( ) ) ; / / Sort the pop wrt f i t n e s s f i r s t
/ / Collections . sort ( ioPopulation , new DepthComparator ( ) ) / / Sort wrt f i t n e s s −− I guess no ne
while ( ioPopulation . size ( ) ! = this . parentPopSize )
ioPopulation . remove ( this . parentPopSize ) ;
}
}
Introduction Nursery Main Nursery Genotype Summary References
NURSERY VII
/∗∗
∗Fitness Comparator
∗/
class FitnessComparator implements java . u t i l . Comparator<Genotype >{
public int compare ( Genotype o1 , Genotype o2 ) {
double f i t 1 =o1 . getFitness ( ) ;
double f i t 2 =o2 . getFitness ( ) ;
i f ( f i t 1 < f i t 2 ) return −1;
i f ( f i t 1 == f i t 2 ) return 0;
return 1;
}
}
Introduction Nursery Main Nursery Genotype Summary References
GENOTYPE I
/∗
∗ Genotype . java
∗
∗ Created on September 3 , 2007, 5:19 PM
∗
∗ To change t h i s template , choose Tools | Template Manager
∗ and open the template in the e d i t o r .
∗/
package EvoNursery ;
/∗∗
∗
∗ @author a d i l r a j a
∗/
public class Genotype {
private double [ ] genes ;
private double f i t n e s s ;
private boolean evaluated ;
/∗∗
∗ Creates a new instance of Genotype
∗Sets the genotype to input genotypes
∗/
public Genotype ( double [ ] inGenes ) {
genes=new double [ inGenes . length ] ;
for ( int i =0; i <inGenes . length ; i ++){
this . genes [ i ]= inGenes [ i ] ;
}
Introduction Nursery Main Nursery Genotype Summary References
GENOTYPE II
this . f i t n e s s =Double .MAX_VALUE; / / set i t to a high value
this . evaluated=false ;
}
/∗∗
∗Copy Constructor
∗/
public Genotype ( Genotype copy ) {
double [ ] tmpGenes=copy . getGenotype ( ) ;
this . genes=new double [ tmpGenes . length ] ;
for ( int i =0; i <tmpGenes . length ; i ++){
this . genes [ i ]=tmpGenes [ i ] ;
}
this . f i t n e s s =copy . getFitness ( ) ; / / set i t to a high value
this . evaluated=copy . evaluated ;
}
/∗∗
∗setGenotype
∗/
public void setGenotype ( f i n a l double [ ] inGenes ) {
for ( int i =0; i <inGenes . length ; i ++){
this . genes [ i ]= inGenes [ i ] ;
}
}
/∗∗
∗Get the genotype array
∗/
Introduction Nursery Main Nursery Genotype Summary References
GENOTYPE III
public f i n a l double [ ] getGenotype ( ) {
return this . genes ;
}
/∗∗
∗set the f i t n e s s of the genotype
∗/
public void setFitness ( f i n a l double inFitness ) {
this . f i t n e s s =inFitness ;
}
/∗∗
∗get f i t n e s s of t h i s Genotype
∗/
public f i n a l double getFitness ( ) {
return this . f i t n e s s ;
}
/∗∗
∗Set the evaualted f l a g
∗/
public void setEvaluated ( f i n a l boolean eval ) {
this . evaluated=eval ;
}
/∗∗
∗Get the evaluation f l a g ’ s value
∗/
public f i n a l boolean getEvaluatedFlag ( ) {
return this . evaluated ;
}
Introduction Nursery Main Nursery Genotype Summary References
GENOTYPE IV
}
Introduction Nursery Main Nursery Genotype Summary References
SUMMARY
Evolutionary implements a simple genetic algorithm in
Java.
Implementation was focused at efficiency, ease of use and
simplicity.
It is open source and can be found online.
Introduction Nursery Main Nursery Genotype Summary References
REFERENCES
Evolutionary nursery can be found online.
This presentation is developed with Beamer:
Darmstadt, monarca.

More Related Content

What's hot

Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia岳華 杜
 
Python for text processing
Python for text processingPython for text processing
Python for text processingXiang Li
 
20170415 當julia遇上資料科學
20170415 當julia遇上資料科學20170415 當julia遇上資料科學
20170415 當julia遇上資料科學岳華 杜
 
PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)HemaArora2
 
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"ZendCon
 
The Language for future-julia
The Language for future-juliaThe Language for future-julia
The Language for future-julia岳華 杜
 
Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1PyCon Italia
 
Functions in python
Functions in pythonFunctions in python
Functions in pythonIlian Iliev
 
Python programing
Python programingPython programing
Python programinghamzagame
 
Simulating Evolution and Behaviour
Simulating Evolution and BehaviourSimulating Evolution and Behaviour
Simulating Evolution and BehaviourAbhranil Das
 
生態文化ニッチモデリングによる分布推定
生態文化ニッチモデリングによる分布推定生態文化ニッチモデリングによる分布推定
生態文化ニッチモデリングによる分布推定Yasuhisa Kondo
 
Python 표준 라이브러리
Python 표준 라이브러리Python 표준 라이브러리
Python 표준 라이브러리용 최
 
Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...
Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...
Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...Johannes Schildgen
 

What's hot (20)

Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia
 
Python for text processing
Python for text processingPython for text processing
Python for text processing
 
Functions
FunctionsFunctions
Functions
 
Python introduction
Python introductionPython introduction
Python introduction
 
20170415 當julia遇上資料科學
20170415 當julia遇上資料科學20170415 當julia遇上資料科學
20170415 當julia遇上資料科學
 
Scala, just a better java?
Scala, just a better java?Scala, just a better java?
Scala, just a better java?
 
PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)
 
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
 
The Language for future-julia
The Language for future-juliaThe Language for future-julia
The Language for future-julia
 
Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1Cleanup and new optimizations in WPython 1.1
Cleanup and new optimizations in WPython 1.1
 
Functions in python
Functions in pythonFunctions in python
Functions in python
 
Python Basic
Python BasicPython Basic
Python Basic
 
Python programing
Python programingPython programing
Python programing
 
Simulating Evolution and Behaviour
Simulating Evolution and BehaviourSimulating Evolution and Behaviour
Simulating Evolution and Behaviour
 
生態文化ニッチモデリングによる分布推定
生態文化ニッチモデリングによる分布推定生態文化ニッチモデリングによる分布推定
生態文化ニッチモデリングによる分布推定
 
Ruby Gotchas
Ruby GotchasRuby Gotchas
Ruby Gotchas
 
Python 표준 라이브러리
Python 표준 라이브러리Python 표준 라이브러리
Python 표준 라이브러리
 
Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...
Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...
Marimba - Ein MapReduce-basiertes Programmiermodell für selbstwartbare Aggreg...
 
Python Part 1
Python Part 1Python Part 1
Python Part 1
 
python codes
python codespython codes
python codes
 

Viewers also liked

Best nursery school kindergarten software system in kuwait saudi arabia
Best nursery school kindergarten software system in kuwait saudi arabiaBest nursery school kindergarten software system in kuwait saudi arabia
Best nursery school kindergarten software system in kuwait saudi arabiaEmstell Technology Consulting
 
Shared Learning Team - Obesity
Shared Learning Team - ObesityShared Learning Team - Obesity
Shared Learning Team - Obesitykylienapa
 
Prevention of obesity among children
Prevention of obesity among childrenPrevention of obesity among children
Prevention of obesity among childrenkhaycee_07
 
Learning object
Learning objectLearning object
Learning objectbeahalal
 
Market Research Report : Pre School Market in India 2012
Market Research Report : Pre School Market in India 2012Market Research Report : Pre School Market in India 2012
Market Research Report : Pre School Market in India 2012Netscribes, Inc.
 
Aidah Beatrice Causing's Portfolio - Nursery @ Pail and Shovel
Aidah Beatrice Causing's Portfolio - Nursery @ Pail and ShovelAidah Beatrice Causing's Portfolio - Nursery @ Pail and Shovel
Aidah Beatrice Causing's Portfolio - Nursery @ Pail and ShovelAlbert Causing
 
Math Worksheets For Kindergarten and Preschool
Math Worksheets For Kindergarten and PreschoolMath Worksheets For Kindergarten and Preschool
Math Worksheets For Kindergarten and Preschoolmamakey08
 
Use of colors in web and graphic design
Use of colors in web and graphic designUse of colors in web and graphic design
Use of colors in web and graphic designNida Aslam
 
Math grade 1
Math grade 1Math grade 1
Math grade 1pipipi
 
Colours: PowerPoint Presentation + Game
Colours: PowerPoint Presentation + GameColours: PowerPoint Presentation + Game
Colours: PowerPoint Presentation + GameA. Simoes
 
Color guessing game
Color guessing gameColor guessing game
Color guessing gamea8061142
 
Grade 1 Addition and Subtraction
Grade 1 Addition and SubtractionGrade 1 Addition and Subtraction
Grade 1 Addition and SubtractionChristian Niebres
 
Basic math (addition)
Basic math (addition)Basic math (addition)
Basic math (addition)itutor
 
Addition presentation power point
Addition presentation power pointAddition presentation power point
Addition presentation power pointmarshe6264
 
Addition and Subtraction ppt.
Addition and Subtraction ppt.Addition and Subtraction ppt.
Addition and Subtraction ppt.Daisy Urnos
 

Viewers also liked (20)

Choosing a nursery or childcare
Choosing a nursery or childcareChoosing a nursery or childcare
Choosing a nursery or childcare
 
Ingles
InglesIngles
Ingles
 
Best nursery school kindergarten software system in kuwait saudi arabia
Best nursery school kindergarten software system in kuwait saudi arabiaBest nursery school kindergarten software system in kuwait saudi arabia
Best nursery school kindergarten software system in kuwait saudi arabia
 
Shared Learning Team - Obesity
Shared Learning Team - ObesityShared Learning Team - Obesity
Shared Learning Team - Obesity
 
Prevention of obesity among children
Prevention of obesity among childrenPrevention of obesity among children
Prevention of obesity among children
 
Learning object
Learning objectLearning object
Learning object
 
Market Research Report : Pre School Market in India 2012
Market Research Report : Pre School Market in India 2012Market Research Report : Pre School Market in India 2012
Market Research Report : Pre School Market in India 2012
 
My Math Adventure - Nursery
My Math Adventure - NurseryMy Math Adventure - Nursery
My Math Adventure - Nursery
 
Ngmtx1
Ngmtx1Ngmtx1
Ngmtx1
 
Aidah Beatrice Causing's Portfolio - Nursery @ Pail and Shovel
Aidah Beatrice Causing's Portfolio - Nursery @ Pail and ShovelAidah Beatrice Causing's Portfolio - Nursery @ Pail and Shovel
Aidah Beatrice Causing's Portfolio - Nursery @ Pail and Shovel
 
Math Talino
Math TalinoMath Talino
Math Talino
 
Math Worksheets For Kindergarten and Preschool
Math Worksheets For Kindergarten and PreschoolMath Worksheets For Kindergarten and Preschool
Math Worksheets For Kindergarten and Preschool
 
Use of colors in web and graphic design
Use of colors in web and graphic designUse of colors in web and graphic design
Use of colors in web and graphic design
 
Math grade 1
Math grade 1Math grade 1
Math grade 1
 
Colours: PowerPoint Presentation + Game
Colours: PowerPoint Presentation + GameColours: PowerPoint Presentation + Game
Colours: PowerPoint Presentation + Game
 
Color guessing game
Color guessing gameColor guessing game
Color guessing game
 
Grade 1 Addition and Subtraction
Grade 1 Addition and SubtractionGrade 1 Addition and Subtraction
Grade 1 Addition and Subtraction
 
Basic math (addition)
Basic math (addition)Basic math (addition)
Basic math (addition)
 
Addition presentation power point
Addition presentation power pointAddition presentation power point
Addition presentation power point
 
Addition and Subtraction ppt.
Addition and Subtraction ppt.Addition and Subtraction ppt.
Addition and Subtraction ppt.
 

Similar to Evolutionary Nursery

Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdfListings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdfRAJATCHUGH12
 
package employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdfpackage employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdfanwarsadath111
 
Transaction is a monad
Transaction is a  monadTransaction is a  monad
Transaction is a monadJarek Ratajski
 
object_oriented_programming.pptx
object_oriented_programming.pptxobject_oriented_programming.pptx
object_oriented_programming.pptxssusereae59d
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingChamithSaranga
 
import java-util-Random- public class GA { int PopulationSize- int i.pdf
import java-util-Random-   public class GA { int PopulationSize- int i.pdfimport java-util-Random-   public class GA { int PopulationSize- int i.pdf
import java-util-Random- public class GA { int PopulationSize- int i.pdfasarudheen07
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Lin Yo-An
 
package employeeType.employee;public abstract class Employee {  .pdf
package employeeType.employee;public abstract class Employee {  .pdfpackage employeeType.employee;public abstract class Employee {  .pdf
package employeeType.employee;public abstract class Employee {  .pdfnipuns1983
 
Code Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfCode Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfankitmobileshop235
 
Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Oliver Klee
 
Tested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdfTested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdfanuradhasilks
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3Oliver Klee
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodecamp Romania
 
Effective Java - Enum and Annotations
Effective Java - Enum and AnnotationsEffective Java - Enum and Annotations
Effective Java - Enum and AnnotationsRoshan Deniyage
 
BasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdfBasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdfankitmobileshop235
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In JavaAndrei Solntsev
 

Similar to Evolutionary Nursery (20)

Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdfListings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
Listings for BinaryHeap.java and BinaryHeapTest.java are shown in th.pdf
 
Java Beagle
Java BeagleJava Beagle
Java Beagle
 
package employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdfpackage employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdf
 
Transaction is a monad
Transaction is a  monadTransaction is a  monad
Transaction is a monad
 
object_oriented_programming.pptx
object_oriented_programming.pptxobject_oriented_programming.pptx
object_oriented_programming.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
import java-util-Random- public class GA { int PopulationSize- int i.pdf
import java-util-Random-   public class GA { int PopulationSize- int i.pdfimport java-util-Random-   public class GA { int PopulationSize- int i.pdf
import java-util-Random- public class GA { int PopulationSize- int i.pdf
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
package employeeType.employee;public abstract class Employee {  .pdf
package employeeType.employee;public abstract class Employee {  .pdfpackage employeeType.employee;public abstract class Employee {  .pdf
package employeeType.employee;public abstract class Employee {  .pdf
 
Code Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfCode Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdf
 
Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)
 
Class 3 2ciclo
Class 3 2cicloClass 3 2ciclo
Class 3 2ciclo
 
Class 3 2ciclo
Class 3 2cicloClass 3 2ciclo
Class 3 2ciclo
 
Tested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdfTested on Eclipse and both class should be in same packageimport.pdf
Tested on Eclipse and both class should be in same packageimport.pdf
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
 
Effective Java - Enum and Annotations
Effective Java - Enum and AnnotationsEffective Java - Enum and Annotations
Effective Java - Enum and Annotations
 
Maze
MazeMaze
Maze
 
BasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdfBasicPizza.javapublic class BasicPizza { Declaring instance .pdf
BasicPizza.javapublic class BasicPizza { Declaring instance .pdf
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In Java
 

More from adil raja

A Software Requirements Specification
A Software Requirements SpecificationA Software Requirements Specification
A Software Requirements Specificationadil raja
 
NUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
NUAV - A Testbed for Development of Autonomous Unmanned Aerial VehiclesNUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
NUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehiclesadil raja
 
DevOps Demystified
DevOps DemystifiedDevOps Demystified
DevOps Demystifiedadil raja
 
On Research (And Development)
On Research (And Development)On Research (And Development)
On Research (And Development)adil raja
 
Simulators as Drivers of Cutting Edge Research
Simulators as Drivers of Cutting Edge ResearchSimulators as Drivers of Cutting Edge Research
Simulators as Drivers of Cutting Edge Researchadil raja
 
The Knock Knock Protocol
The Knock Knock ProtocolThe Knock Knock Protocol
The Knock Knock Protocoladil raja
 
File Transfer Through Sockets
File Transfer Through SocketsFile Transfer Through Sockets
File Transfer Through Socketsadil raja
 
Remote Command Execution
Remote Command ExecutionRemote Command Execution
Remote Command Executionadil raja
 
CMM Level 3 Assessment of Xavor Pakistan
CMM Level 3 Assessment of Xavor PakistanCMM Level 3 Assessment of Xavor Pakistan
CMM Level 3 Assessment of Xavor Pakistanadil raja
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousingadil raja
 
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...adil raja
 
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...adil raja
 
Real-Time Non-Intrusive Speech Quality Estimation for VoIP
Real-Time Non-Intrusive Speech Quality Estimation for VoIPReal-Time Non-Intrusive Speech Quality Estimation for VoIP
Real-Time Non-Intrusive Speech Quality Estimation for VoIPadil raja
 
ULMAN GUI Specifications
ULMAN GUI SpecificationsULMAN GUI Specifications
ULMAN GUI Specificationsadil raja
 
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...adil raja
 
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...adil raja
 

More from adil raja (20)

ANNs.pdf
ANNs.pdfANNs.pdf
ANNs.pdf
 
A Software Requirements Specification
A Software Requirements SpecificationA Software Requirements Specification
A Software Requirements Specification
 
NUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
NUAV - A Testbed for Development of Autonomous Unmanned Aerial VehiclesNUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
NUAV - A Testbed for Development of Autonomous Unmanned Aerial Vehicles
 
DevOps Demystified
DevOps DemystifiedDevOps Demystified
DevOps Demystified
 
On Research (And Development)
On Research (And Development)On Research (And Development)
On Research (And Development)
 
Simulators as Drivers of Cutting Edge Research
Simulators as Drivers of Cutting Edge ResearchSimulators as Drivers of Cutting Edge Research
Simulators as Drivers of Cutting Edge Research
 
The Knock Knock Protocol
The Knock Knock ProtocolThe Knock Knock Protocol
The Knock Knock Protocol
 
File Transfer Through Sockets
File Transfer Through SocketsFile Transfer Through Sockets
File Transfer Through Sockets
 
Remote Command Execution
Remote Command ExecutionRemote Command Execution
Remote Command Execution
 
Thesis
ThesisThesis
Thesis
 
CMM Level 3 Assessment of Xavor Pakistan
CMM Level 3 Assessment of Xavor PakistanCMM Level 3 Assessment of Xavor Pakistan
CMM Level 3 Assessment of Xavor Pakistan
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousing
 
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
 
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
Implementation of a Non-Intrusive Speech Quality Assessment Tool on a Mid-Net...
 
Real-Time Non-Intrusive Speech Quality Estimation for VoIP
Real-Time Non-Intrusive Speech Quality Estimation for VoIPReal-Time Non-Intrusive Speech Quality Estimation for VoIP
Real-Time Non-Intrusive Speech Quality Estimation for VoIP
 
VoIP
VoIPVoIP
VoIP
 
ULMAN GUI Specifications
ULMAN GUI SpecificationsULMAN GUI Specifications
ULMAN GUI Specifications
 
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
 
ULMAN-GUI
ULMAN-GUIULMAN-GUI
ULMAN-GUI
 
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
Modeling the Effect of Packet Loss on Speech Quality: Genetic Programming Bas...
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Evolutionary Nursery

  • 1. Introduction Nursery Main Nursery Genotype Summary References EVOLUTIONARY NURSEY THE SOURCE CODE Muhammad Adil Raja Roaming Researchers, Inc. cbna April 27, 2015
  • 2. Introduction Nursery Main Nursery Genotype Summary References OUTLINE I 1 INTRODUCTION 2 NURSERY MAIN 3 NURSERY 4 GENOTYPE 5 SUMMARY 6 REFERENCES
  • 3. Introduction Nursery Main Nursery Genotype Summary References INTRODUCTION Evolutionary nursery is an implementation of a simple genetic algorithm (GA). The algorithm is implemented in Java. The algorithm is aimed at numerical optimization problems. The source code has three main Java files. 1 NurseryMain.java: The main entry point to the program that runs the genetic algorithm. 2 Nursery.java: This class implements the algorithms that are necessary to run the GA, such as crossover and mutation. 3 Genotype.java: The data-type Genotype specifies the implementation of the GA genotype. In what follows you will find the source code of various components of evolutionary nursery.
  • 4. Introduction Nursery Main Nursery Genotype Summary References NURSERY MAIN I /∗ ∗ NurseryMain . java ∗ ∗ Created on September 3 , 2007, 8:52 PM ∗ ∗ To change t h i s template , choose Tools | Template Manager ∗ and open the template in the e d i t o r . ∗/ package EvoNursery ; /∗∗ ∗ ∗ @author a d i l r a j a ∗/ import java . u t i l . ∗ ; public class NurseryMain { /∗∗ Creates a new instance of NurseryMain ∗/ public NurseryMain ( ) { } /∗∗ ∗ @param args the command l i n e arguments ∗/ public static void main ( String [ ] args ) { / / TODO code a p p l i c a t i o n l o g i c here double Fitness =90; double [ ] bestGene=new double [ 2 ] ;
  • 5. Introduction Nursery Main Nursery Genotype Summary References NURSERY MAIN II Nursery nurse=new Nursery ( ) ; ArrayList <Genotype> pop=nurse . i n i t i a l i z e P o p u l a t i o n (300 , 2 , −6, +6); / / should i n i t i a l i z e int numGens=15; while ( true ) { for ( int i =0; i <numGens; i ++){ ArrayList <Genotype> childPop=nurse . applySelectionTournament ( pop , 4 ) ; nurse . applySinglePointCrossover ( childPop , 2 , 0 . 8 ) ; nurse . applyMutationUniform ( childPop , 2 , 0 . 2 ) ; pop . addAll ( childPop ) ; / / append the two pops here for ( int j =0; j <pop . size ( ) ; j ++){ double [ ] tmpGenes=pop . get ( j ) . getGenotype ( ) ; double f i t n e s s =10∗2+tmpGenes [0]∗ tmpGenes[0]−10∗ java . lang . Math . cos(2∗3.141∗tmpG +tmpGenes [1]∗ tmpGenes[1]−10∗ java . lang . Math . cos(2∗3.141∗tmpGenes [ 1 ] ) ; pop . get ( j ) . setFitness ( f i t n e s s ) ; i f ( fitness <Fitness ) { Fitness= f i t n e s s ; bestGene [0]= tmpGenes [ 0 ] ; bestGene [1]= tmpGenes [ 1 ] ; } nurse . applySurvival ( pop ) ; } } System . out . p r i n t l n ( Fitness+" "+bestGene [0]+ " "+bestGene [ 1 ] ) ; } } }
  • 6. Introduction Nursery Main Nursery Genotype Summary References NURSERY I /∗ ∗ Nursery . java ∗ ∗ Created on September 3 , 2007, 5:35 PM ∗ ∗ To change t h i s template , choose Tools | Template Manager ∗ and open the template in the e d i t o r . ∗t h i s i s the f i l e where evolution would occur ∗/ package EvoNursery ; /∗∗ ∗ ∗ @author a d i l r a j a ∗/ import java . u t i l . ∗ ; public class Nursery { /∗∗ ∗ ∗ Creates a new instance of Nursery ∗ I n i t i a l i z e s a population ∗ popSize−population size ∗ numCoeffs−− to be tuned ∗ upperBound −− The upper bound of a number ∗ lower Bound −− The lower bound of a coeff ∗/
  • 7. Introduction Nursery Main Nursery Genotype Summary References NURSERY II private Random dice ; private ArrayList <Integer > lMateVector ; private double span ; private double lowerBound ; private int parentPopSize ; public Nursery ( ) { dice=new Random ( ) ; / /We need a Random number generator this . lMateVector=new ArrayList ( ) ; } /∗∗ ∗ I n i t i a l i z e a population ∗/ public ArrayList <Genotype> i n i t i a l i z e P o p u l a t i o n ( int popSize , int numCoeffs , double upperBo ArrayList <Genotype> population=new ArrayList ( popSize ) ; / / creates an empty l i s t with t h i / / The elements would be added manually this . span=upperBound−lowerBound ; this . lowerBound=lowerBound ; this . parentPopSize=popSize ; double [ ] tmpGenotype=new double [ numCoeffs ] ; for ( int j =0; j <popSize ; j ++){ for ( int i =0; i <numCoeffs ; i ++){ tmpGenotype [ i ]= dice . nextDouble ()∗ span+lowerBound ; } population . add (new Genotype ( tmpGenotype ) ) ;
  • 8. Introduction Nursery Main Nursery Genotype Summary References NURSERY III } return population ; } /∗∗ ∗Puppy Style tournamentSelection ∗/ public ArrayList <Genotype> applySelectionTournament ( ArrayList <Genotype> ioPopulation , int inN { i f ( ioPopulation . size ( ) == 0) return null ; ArrayList <Genotype> childPop=new ArrayList ( ioPopulation . size ( ) ) ; / / choose the f i r s t candidate and store in the c h i l d population while ( childPop . size () <= ioPopulation . size ( ) ) { int j j =0; int lChosenCand1=0 , lChosenCand2=0; int tmpCand1=ioPopulation . size ()+1 , tmpCand2=ioPopulation . size ( ) + 1 ; while ( j j <inNumberParticipants ) { lChosenCand1=dice . nextInt ( ioPopulation . size ( ) ) ; i f ( tmpCand1<ioPopulation . size ( ) ) { i f ( ioPopulation . get ( lChosenCand1 ) . getFitness () < ioPopulation . get ( tmpCand1 ) . getFitness tmpCand1=lChosenCand1 ; / / choose an i n d i v i d u a l , } } else tmpCand1=lChosenCand1 ; / / choose t h i s j j ++; }
  • 9. Introduction Nursery Main Nursery Genotype Summary References NURSERY IV childPop . add (new Genotype ( ioPopulation . get ( tmpCand1 ) ) ) ; / / Add t h i s to the c h i l d population / / choose the second candidate now and store in the c h i l d population j j =0; while ( j j <inNumberParticipants ) { lChosenCand2=dice . nextInt ( ioPopulation . size ( ) ) ; i f ( tmpCand2<=ioPopulation . size ( ) ) { / / implements Gustafson and LPP i f ( ioPopulation . get ( lChosenCand2 ) . getFitness () < ioPopulation . get ( tmpCand2 ) . getFitness { tmpCand2=lChosenCand2 ; / / choose an i n d i v i d u a l , } } else tmpCand2=lChosenCand2 ; / / choose t h i s j j ++; } childPop . add (new Genotype ( ioPopulation . get ( tmpCand2 ) ) ) ; / / Add t h i s to the c h i l d population } return childPop ; } /∗∗ ∗Apply single−point crossover ∗/ public void applySinglePointCrossover ( ArrayList <Genotype> ioPopulation , int genomeLength , dou i f ( ( ioPopulation . size ( ) % 2) != 0) ioPopulation . remove ( lMateVector . size () −1);
  • 10. Introduction Nursery Main Nursery Genotype Summary References NURSERY V for ( int j =0; j <ioPopulation . size ( ) ; j +=2) { double [ ] tmpParent1=ioPopulation . get ( j ) . getGenotype ( ) ; double [ ] tmpParent2=ioPopulation . get ( j +1). getGenotype ( ) ; double swapGene ; int XoverPoint=dice . nextInt ( genomeLength ) ; i f ( genomeLength==2 && XoverPoint ==0) XoverPoint =1; / / The special case when genome length i s for ( int i =0; i <XoverPoint ; i ++){ swapGene=tmpParent1 [ i ] ; tmpParent1 [ i ]= tmpParent2 [ i ] ; tmpParent2 [ i ]=swapGene ; / / xover i s no big deal } ioPopulation . get ( j ) . setEvaluated ( false ) ; ioPopulation . get ( j +1). setEvaluated ( false ) ; } } /∗∗ ∗Applies standard mutation to the population . The numbers are drawn from a uniform d i s t r i b u t a ∗/ public void applyMutationUniform ( ArrayList <Genotype> ioPopulation , int genomeLength , double mu I t e r a t o r <Genotype> genoIt=ioPopulation . i t e r a t o r ( ) ; while ( genoIt . hasNext ( ) ) { boolean f l a g =false ; Genotype genome=genoIt . next ( ) ; double [ ] tmpParent=genome . getGenotype ( ) ;
  • 11. Introduction Nursery Main Nursery Genotype Summary References NURSERY VI for ( int i =0; i <genomeLength ; i ++){ i f ( dice . nextDouble () <= mutationProb ) { tmpParent [ i ]= dice . nextDouble ()∗ this . span+this . lowerBound ; f l a g =true ; } } i f ( f l a g ) genome . setEvaluated ( false ) ; } } /∗∗ ∗an e l i t i s t s u r v i v a l c r i t e r i o n ∗/ public void applySurvival ( ArrayList <Genotype> ioPopulation ) { Collections . sort ( ioPopulation , new FitnessComparator ( ) ) ; / / Sort the pop wrt f i t n e s s f i r s t / / Collections . sort ( ioPopulation , new DepthComparator ( ) ) / / Sort wrt f i t n e s s −− I guess no ne while ( ioPopulation . size ( ) ! = this . parentPopSize ) ioPopulation . remove ( this . parentPopSize ) ; } }
  • 12. Introduction Nursery Main Nursery Genotype Summary References NURSERY VII /∗∗ ∗Fitness Comparator ∗/ class FitnessComparator implements java . u t i l . Comparator<Genotype >{ public int compare ( Genotype o1 , Genotype o2 ) { double f i t 1 =o1 . getFitness ( ) ; double f i t 2 =o2 . getFitness ( ) ; i f ( f i t 1 < f i t 2 ) return −1; i f ( f i t 1 == f i t 2 ) return 0; return 1; } }
  • 13. Introduction Nursery Main Nursery Genotype Summary References GENOTYPE I /∗ ∗ Genotype . java ∗ ∗ Created on September 3 , 2007, 5:19 PM ∗ ∗ To change t h i s template , choose Tools | Template Manager ∗ and open the template in the e d i t o r . ∗/ package EvoNursery ; /∗∗ ∗ ∗ @author a d i l r a j a ∗/ public class Genotype { private double [ ] genes ; private double f i t n e s s ; private boolean evaluated ; /∗∗ ∗ Creates a new instance of Genotype ∗Sets the genotype to input genotypes ∗/ public Genotype ( double [ ] inGenes ) { genes=new double [ inGenes . length ] ; for ( int i =0; i <inGenes . length ; i ++){ this . genes [ i ]= inGenes [ i ] ; }
  • 14. Introduction Nursery Main Nursery Genotype Summary References GENOTYPE II this . f i t n e s s =Double .MAX_VALUE; / / set i t to a high value this . evaluated=false ; } /∗∗ ∗Copy Constructor ∗/ public Genotype ( Genotype copy ) { double [ ] tmpGenes=copy . getGenotype ( ) ; this . genes=new double [ tmpGenes . length ] ; for ( int i =0; i <tmpGenes . length ; i ++){ this . genes [ i ]=tmpGenes [ i ] ; } this . f i t n e s s =copy . getFitness ( ) ; / / set i t to a high value this . evaluated=copy . evaluated ; } /∗∗ ∗setGenotype ∗/ public void setGenotype ( f i n a l double [ ] inGenes ) { for ( int i =0; i <inGenes . length ; i ++){ this . genes [ i ]= inGenes [ i ] ; } } /∗∗ ∗Get the genotype array ∗/
  • 15. Introduction Nursery Main Nursery Genotype Summary References GENOTYPE III public f i n a l double [ ] getGenotype ( ) { return this . genes ; } /∗∗ ∗set the f i t n e s s of the genotype ∗/ public void setFitness ( f i n a l double inFitness ) { this . f i t n e s s =inFitness ; } /∗∗ ∗get f i t n e s s of t h i s Genotype ∗/ public f i n a l double getFitness ( ) { return this . f i t n e s s ; } /∗∗ ∗Set the evaualted f l a g ∗/ public void setEvaluated ( f i n a l boolean eval ) { this . evaluated=eval ; } /∗∗ ∗Get the evaluation f l a g ’ s value ∗/ public f i n a l boolean getEvaluatedFlag ( ) { return this . evaluated ; }
  • 16. Introduction Nursery Main Nursery Genotype Summary References GENOTYPE IV }
  • 17. Introduction Nursery Main Nursery Genotype Summary References SUMMARY Evolutionary implements a simple genetic algorithm in Java. Implementation was focused at efficiency, ease of use and simplicity. It is open source and can be found online.
  • 18. Introduction Nursery Main Nursery Genotype Summary References REFERENCES Evolutionary nursery can be found online. This presentation is developed with Beamer: Darmstadt, monarca.