machine scheduling

45 views
Skip to first unread message

Zia

unread,
Sep 26, 2007, 12:36:07 PM9/26/07
to Java Genetic Algorithm (JGA)
Dear Andres!
Thanx a lot for ur detailed reply and JGA forum
ofcourse:=).

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.
>
>
>

amedagli

unread,
Sep 26, 2007, 7:43:48 PM9/26/07
to Java Genetic Algorithm (JGA)
Zia,

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 -

sha...@soton.ac.uk

unread,
Sep 27, 2007, 6:06:43 AM9/27/07
to copa...@googlegroups.com

Thanx it is working now with the modification of the toString() method.

regards
zia


JGA-admin

unread,
Sep 27, 2007, 9:03:11 AM9/27/07
to Java Genetic Algorithm (JGA)
Glad it worked!

Andres

Message has been deleted

Jorge E. Mendoza

unread,
Sep 27, 2007, 3:55:14 PM9/27/07
to Java Genetic Algorithm (JGA)
I've have worked in a couple of single machine scheduling problems
concerned with tardiness and earliness, considering set-up times, but
I have never dealt with machine idle times. My guess is that if the
idle times appear only at the beginning and end of the schedule, and
you are working non-finite planning horizon (which is the normal
scenario for these scheduling problems) the problem can be treated as
a regular problem. This means that you can design your schedule
without considering idle times and once on the shop you start your
production run as soon as the machine ends its idle period. If you
have a finite planning horizon (i.e a shift duration constraint) you
can introduce it as a due date to each job so the algorithm finds and
incentive to schedule it before the start point of the idle period.

Hope this was useful.

sha...@soton.ac.uk

unread,
Sep 28, 2007, 6:46:27 AM9/28/07
to copa...@googlegroups.com
thanx jor mend! it is useful... My problem does have an interval constarint
i.e all the jobs have to be finished within a specific time period. Would u
pls further eloborate on :
"If yoo have a finite planning horizon (i.e a shift duration

constraint) you can introduce it as a due date to each job so the
algorithm finds and incentive to schedule it before the start point of the
idle period."

Regards

Zia

Reply all
Reply to author
Forward
0 new messages