Robot Agent  1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Enumerations | Functions
pheromone.h File Reference
#include "enviroment.h"
#include "robot.h"
#include "config.h"

Go to the source code of this file.

Data Structures

struct  s_PHEROMONE_STRUCT
 Pheromone structure. More...
 
struct  s_PHEROMONE_MAP_SECTOR_STRUCT
 Pheromone Map Sector structure. More...
 

Typedefs

typedef struct s_PHEROMONE_STRUCT pheromone_t
 Pheromone structure. More...
 
typedef struct
s_PHEROMONE_MAP_SECTOR_STRUCT 
pheromone_map_sector_t
 Pheromone Map Sector structure. More...
 

Enumerations

enum  s_PHEROMONE_DIR {
  s_PH_LEFT = 0, s_PH_TOP_LEFT, s_PH_TOP, s_PH_TOP_RIGHT,
  s_PH_RIGHT, s_PH_NONE
}
 Enum for directions. More...
 

Functions

pheromone_tpheromone_init (enviroment_t *env, int width, int lifetime, int pheromone_radius, int eval_radius, int eval_dist, int sector_max_size)
 
void pheromone_destroy (pheromone_t *ph)
 
void pheromone_make_stencil (int ***stencil, int size)
 
void pheromone_put (pheromone_t *ph, int x, int y)
 
int pheromone_eval (pheromone_t *ph, robot_t *robot)
 
void pheromone_map_update (pheromone_t *ph, pheromone_map_sector_t *phms)
 
pheromone_map_sector_t ** pheromone_map_extract (pheromone_t *ph)
 
void pheromone_map_destroy (pheromone_t *ph, pheromone_map_sector_t **phms)
 

Detailed Description

Author
Eriks Zaharans
Date
18 Jul 2013

DESCRIPTION

Pheromone library header file.

Definition in file pheromone.h.

Typedef Documentation

Pheromone Map Sector structure.

Pheromone structure.

Enumeration Type Documentation

Enum for directions.

Enumerator
s_PH_LEFT 
s_PH_TOP_LEFT 
s_PH_TOP 
s_PH_TOP_RIGHT 
s_PH_RIGHT 
s_PH_NONE 

Definition at line 72 of file pheromone.h.

Function Documentation

void pheromone_destroy ( pheromone_t ph)

Deinitialize pheromones

Parameters
phPointer to pheromone structure
Returns
Void

Definition at line 109 of file pheromone.c.

int pheromone_eval ( pheromone_t ph,
robot_t robot 
)

Evaluate smell in pheromone map and return new heading direction

Parameters
phPointer to pheromone structure
robotRobot structure
Returns
Direction to move

Definition at line 219 of file pheromone.c.

pheromone_t* pheromone_init ( enviroment_t env,
int  width,
int  lifetime,
int  pheromone_radius,
int  eval_radius,
int  eval_dist,
int  sector_max_size 
)

Initialize pheromones

Parameters
phPointer to pheromone structure
envnviroment structure
width
lifetime
smell_radius
scan_radius
sector_max_size
Returns
Pointer to pheromone structure

Definition at line 40 of file pheromone.c.

void pheromone_make_stencil ( int ***  stencil,
int  size 
)

Make stencil - generate circle area in 2D array

Parameters
stencilPointer to 2D array
sizeSize of the stencil
Returns
Void

Definition at line 146 of file pheromone.c.

void pheromone_map_destroy ( pheromone_t ph,
pheromone_map_sector_t **  phms 
)

Destroy (free memory) array of pheromone map sectors

Parameters
phPointer to pheromone structure
phmsPointer to array of pheromone map sector structures
Returns
Void

Definition at line 449 of file pheromone.c.

pheromone_map_sector_t** pheromone_map_extract ( pheromone_t ph)

Extract array of pheromone map sectors

Parameters
phPointer to pheromone structure
Returns
Pointer to array of pheromone map sector structures

Definition at line 371 of file pheromone.c.

void pheromone_map_update ( pheromone_t ph,
pheromone_map_sector_t phms 
)

Update pheromone map

Parameters
phPointer to pheromone structure
phmsPointer to pheromone map sector structure
Returns
Void

Definition at line 336 of file pheromone.c.

void pheromone_put ( pheromone_t ph,
int  x,
int  y 
)

Put pheromone in pheromone map

Parameters
phPointer to pheromone structure
xX coordinate of pheromone center
yY coordinate of pheromone center
timeTime of placment
Returns
Void

Definition at line 174 of file pheromone.c.