genetic.c File Reference

Genetic algorithm. More...

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <pvm3.h>
#include "assert.h"
#include "main.h"
#include "chromo.h"
#include "transfer.h"
#include "error.h"
#include "genetic.h"
#include "data.h"
#include "modsup.h"
#include "params.h"
#include "cache.h"
#include "depend.h"
#include "gettext.h"

Functions

static void table_mate (table *s1, table *s2, table *d1, table *d2)
 Perform crossover operation between two timetables.
static void table_mutate (table *t1)
 Perform mutation on a timetable.
static void table_rand (table *t1)
 Perform randomization on a timetable.
static int table_compare (const void *t1, const void *t2)
 Compares fitness value of timetable t1 to timetable t2.
void new_generation (population *pop)
 Makes a new generation in the population.

Variables

int sibling


Detailed Description

Genetic algorithm.


Function Documentation

void new_generation ( population pop  ) 

Makes a new generation in the population.

Parameters:
pop Pointer to the population struct.

static int table_compare ( const void *  t1,
const void *  t2 
) [static]

Compares fitness value of timetable t1 to timetable t2.

Parameters:
t1 Pointer to the first timetable.
t2 Pointer to the second timetable.
Returns:
Less than zero if the first timetable is better, Greater than zero if the fist timetable is worse. 0 if they are equal.

static void table_mate ( table s1,
table s2,
table d1,
table d2 
) [static]

Perform crossover operation between two timetables.

Parameters:
s1 First parent.
s2 Second parent.
d1 First child.
d2 Second child.

static void table_mutate ( table t1  )  [static]

Perform mutation on a timetable.

Parameters:
t1 Timetable to mutate.

static void table_rand ( table t1  )  [static]

Perform randomization on a timetable.

Parameters:
t1 Timetable to randomize.


Generated on Tue Jul 3 13:23:36 2007 for Tablix by  doxygen 1.5.2