chromo.c File Reference

Dynamic data storage (chromosomes). More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "assert.h"
#include "gettext.h"
#include "modsup.h"
#include "chromo.h"
#include "data.h"

Functions

tabletable_new (int typenum, int tuplenum)
 Allocates a new table structure.
void table_free (table *tab)
 Free a table structure.
populationpopulation_new (int size, int typenum, int tuplenum)
 Allocates population structure.
void population_free (population *pop)
 Free all allocated memory in a population struct.
populationpopulation_load (char *filename)
 Loads population from a file.
int population_save (char *filename, population *pop)
 Saves population to a file.


Detailed Description

Dynamic data storage (chromosomes).


Function Documentation

void population_free ( population pop  ) 

Free all allocated memory in a population struct.

Parameters:
pop Pointer to the population struct to be freed.

population* population_load ( char *  filename  ) 

Loads population from a file.

Parameters:
filename Name of the file with the saved population.
Returns:
Pointer to the loaded population struct or NULL if failed.

population* population_new ( int  size,
int  typenum,
int  tuplenum 
)

Allocates population structure.

Parameters:
size Size of the population.
typenum Number of defined resource types.
tuplenum Number of defined tuples.
Returns:
Pointer to the allocated structure or NULL on error.

int population_save ( char *  filename,
population pop 
)

Saves population to a file.

Parameters:
filename Name of the file for the saved population.
pop Pointer to the population struct to be saved.
Returns:
0 if successful and -1 on error.

void table_free ( table tab  ) 

Free a table structure.

Parameters:
tab Pointer to the table structure.

table* table_new ( int  typenum,
int  tuplenum 
)

Allocates a new table structure.

Parameters:
typenum Number of defined resource types.
tuplenum Number of defined tuples.
Returns:
Pointer to the allocated struct or NULL on error.


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