I have overwritten the print method in the my genotype class
extending
IntegerGenotype but still the problem persists. The stange thing is
that I
have also implemented my single machine problem now as a permutation
problem using PermutationGenotype but print output to the console is
perfectly ok in this case. I am still curious how the print output to
the
console could be destorted without touching any of the super class
methods
in the IntegerGenotype of the single machine problem implementation
(with
random generartion of start times and penalising any early or tardy
jobs).
Another quick querry. Do u have any experience with single machine
schedulig
as a pure permutation type problem with idle time inserted at the
beginning
and end of schedule. I have gethered enough literature but none has
reported such scenorio.
regards
zia
Quoting Andrés Medaglia González <amed...@uniandes.edu.co>:
> Hi Zia,
>
> Sorry for not responding earlier.
>
> Your questions are quite interesting and I feel we should try to open a
> Google Group to address them in a timely manner. I'll be sending you an
> invitation to join this group.
>
> Now with regard to your questions:
>
> 1) You should create a class extending IntegerGenotype, say ZiaGenotype,
> which overwrites the "print" method. You can print whatever you want.
>
> public void print(){
> System.out.print("IntegerGenotype : <");
> for (int i=0; i < Genes.length; i++){
> System.out.print(" "+Genes[i]);
> }
> System.out.println(" >");
> }
>
> Enclosed please find a genotype that prints a table for the Uncapacitated
> Lot Sizing. That's a complete example which extends BinaryGenotype.
>
> 2) To add a different stopping criterion, you will need to modify the
> BasicGeneticAlgorithm or extend a new class called ZiaGA from Genetic
> Algorithm where you add any changes to the logic of the GA. In a
> nutshell,
> you will need to modify the "terminate" method to add your "aging"
> stopping
> criterion (i.e., convergence).
>
> private boolean terminateGA()
> {
> boolean finish = false;
> if (generationNumber > GASettings.instance().getMaxGenerations())
> {
> finish = true;
> }
> return finish;
> }
> Enclosed please find the code of BasicGeneticAlgorithm.
>
> 3) Actually, there are many additions to be made. Jorge Rodriguez, who I
> am
> bc'ing, has worked on something along those lines. Also, Jose L.
> Walteros.
> The former, uses a genotype called RZGenotype, which mixes integer and
> real
> genotypes. The latter, has used multi-point genotypes. Perhaps they could
> share their code. I'll also be inviting them to join our JGA group.
>
> Happy JGA coding!!!
>
> Andrés
>
>
> -----Original Message-----
> From: sha...@soton.ac.uk [mailto:sha...@soton.ac.uk]
> Sent: Monday, September 17, 2007 6:38 AM
> To: Andrés Medaglia González
> Subject: RE: JGA
>
>
> Dear Andrés,
>
> I have now successfully implemented my constarined single
> machine scheduling problem with earliness/tardiness(ET) by using TSP
> example as a template but using IntegerGenotype instaed. It is working
> perfectly but the out put "IntegerGenotype" and "Phenotype"is not printed
> to
> the console as it is in TSP example. For example the last two lines are
> showing up in console as:
>
> Best Individual:
> >
> IntegerGenotype :< 8039 2189 2648 2781 5646 7385 8931Phenotype
> :1.98663708E8
>
>
> Which seems a bit deformed with the sign " > " going up by one line,
> instead
> of being just before the word "Phenotype". I could'nt tidy it as it is
> coming I guess from the hidden classes in the library.
>
> The second question is regarding the stopping criteria. Is it the number
> of
> maximum generation only or there is also a hidden %age improvement
> criteria
> somewhere in the built in classes. Sometimes it is wasteful to be just
> waiting till the last generation if there is no improvement.
>
> Third,are you thinking of adding a two point crossover class and another
> integer genotype class which generates a chromosome with multiple
> sections(may be two in my case) and each section has a different range.
>
> Waiting anxiously for your reply.
>
> Best regards,
>
> Zia Ul Haq.
>
> Uni of Southampton, UK.
>
>
>
Here is the code used to print the PermutationGenotype. If you like
how it is printed, you can try to reuse it (in an extended class) to
print your Genotype as you wish:
=================
/**
* Prints formatted representation of the genotype in the standard
output
*/
public void print()
{
System.out.print("PermutationGenotype: <");
for (int i = 0; i < genes.length; i++)
{
System.out.print(" | " + genes[i]);
}
System.out.println(" >");
}
/**
* @return A string representation of the Permutationgenotype
*/
public String toString()
{
String string = new String("PermutationGenotype: <");
for (int i = 0; i < genes.length; i++)
{
string = string + " " + genes[i];
}
string = string + " >";
return string;
}
===================
Bear in mind that what you see is a printed Individual (or best
individual) which is in turned produced by:
==========
/**
* Prints formatted representation of the individual in the standard
output
*/
public void print(){
genotype.print();
phenotype.print();
}
/**
* @return A string representation of the individual
*/
public String toString(){
return genotype.toString()+phenotype.toString();
}
=========
You will have to take this into account, because the genotype is
followed immediately by the phenotype. If you want some spacing, you
should add them in the genoytpe print method.
With regard to the scheduling part, I hope Jorge Mendoza (jor-mend) or
Eliécer Gutiérrez (egutierr) respond to you.
Best.
Andrés
> > Uni of Southampton, UK.- Hide quoted text -
>
> - Show quoted text -
regards
zia
Andres
Hope this was useful.
Regards
Zia