chromo.h File Reference

This graph shows which files directly or indirectly include this file:


Data Structures

struct  resource_t
 Resource structure. More...
struct  resourcetype_t
 Resource type structure. More...
struct  domain_t
 Domain structure. More...
struct  chromo_t
 Chromosome structure. More...
struct  table_t
 Timetable structure. More...
struct  population_t
 Population structure. More...
struct  tupleinfo_t
 This structure holds information about defined tuples (events). More...

Defines

#define RES_ALLOC_CHUNK   10
 Number of resource structs to allocate at once.
#define TUPLE_ALLOC_CHUNK   10
 Number of tuples to allocate at once.

Typedefs

typedef resource_t resource
typedef resourcetype_t resourcetype
typedef domain_t domain
typedef chromo_t chromo
typedef table_t table
typedef population_t population
typedef tupleinfo_t tupleinfo

Functions

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.
tabletable_new (int typenum, int tuplenum)
 Allocates a new table structure.
void table_free (table *tab)
 Free a table structure.

Detailed Description


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:36 2007 for Tablix by  doxygen 1.5.2