Robot Agent
1.0
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include "pheromone.h"
#include "enviroment.h"
#include "general.h"
#include "def.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
pheromone_t * | pheromone_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) |
void pheromone_destroy | ( | pheromone_t * | ph | ) |
Deinitialize pheromones
ph | Pointer to pheromone structure |
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
ph | Pointer to pheromone structure |
robot | Robot structure |
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
ph | Pointer to pheromone structure |
env | nviroment structure |
width | |
lifetime | |
smell_radius | |
scan_radius | |
sector_max_size |
Definition at line 40 of file pheromone.c.
void pheromone_make_stencil | ( | int *** | stencil, |
int | size | ||
) |
Make stencil - generate circle area in 2D array
stencil | Pointer to 2D array |
size | Size of the stencil |
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
ph | Pointer to pheromone structure |
phms | Pointer to array of pheromone map sector structures |
Definition at line 449 of file pheromone.c.
pheromone_map_sector_t** pheromone_map_extract | ( | pheromone_t * | ph | ) |
Extract array of pheromone map sectors
ph | Pointer to pheromone structure |
Definition at line 371 of file pheromone.c.
void pheromone_map_update | ( | pheromone_t * | ph, |
pheromone_map_sector_t * | phms | ||
) |
Update pheromone map
ph | Pointer to pheromone structure |
phms | Pointer to pheromone map sector structure |
Definition at line 336 of file pheromone.c.
void pheromone_put | ( | pheromone_t * | ph, |
int | x, | ||
int | y | ||
) |
Put pheromone in pheromone map
ph | Pointer to pheromone structure |
x | X coordinate of pheromone center |
y | Y coordinate of pheromone center |
time | Time of placment |
Definition at line 174 of file pheromone.c.