Noble Ape
The Central Directories of the Noble Ape Simulation.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
food.c File Reference

Functions related to eating. More...

#include "entity.h"
#include "entity_internal.h"
Include dependency graph for food.c:

Go to the source code of this file.

Macros

#define GENE_ENERGY_FROM_VEGETABLES(gene)   GENE_VAL_REG(gene, 3, 13, 15, 3)
#define GENE_ENERGY_FROM_FRUITS(gene)   GENE_VAL_REG(gene, 14, 7, 6, 4)
#define GENE_ENERGY_FROM_SHELLFISH(gene)   GENE_VAL_REG(gene, 10, 12, 12, 2)
#define GENE_ENERGY_FROM_SEAWEED(gene)   GENE_VAL_REG(gene, 0, 9, 11, 12)
#define GENE_ENERGY_FROM_BIRD_EGGS(gene)   GENE_VAL_REG(gene, 7, 1, 9, 5)
#define GENE_ENERGY_FROM_LIZARD_EGGS(gene)   GENE_VAL_REG(gene, 15, 3, 12, 8)

Functions

n_int food_absorption (noble_being *local, n_int max_energy, n_byte food_type)
 How much energy is absorbed from a given type of food.
void food_values (n_land *local_land, n_int loc_x, n_int loc_y, n_int *grass, n_int *trees, n_int *bush)
 Returns the values for grass, trees and bushes at the given location.
n_int food_eat (n_land *local_land, n_int loc_x, n_int loc_y, n_int az, n_byte *food_type, noble_being *local_being)
 Eat food at the given location and return the energy increase.

Detailed Description

Functions related to eating.

Definition in file food.c.


Macro Definition Documentation

#define GENE_ENERGY_FROM_BIRD_EGGS (   gene)    GENE_VAL_REG(gene, 7, 1, 9, 5)

Energy from bird eggs

Definition at line 62 of file food.c.

#define GENE_ENERGY_FROM_FRUITS (   gene)    GENE_VAL_REG(gene, 14, 7, 6, 4)

Energy from fruits

Definition at line 50 of file food.c.

#define GENE_ENERGY_FROM_LIZARD_EGGS (   gene)    GENE_VAL_REG(gene, 15, 3, 12, 8)

Energy from lizard eggs

Definition at line 66 of file food.c.

#define GENE_ENERGY_FROM_SEAWEED (   gene)    GENE_VAL_REG(gene, 0, 9, 11, 12)

Energy from seaweed

Definition at line 58 of file food.c.

#define GENE_ENERGY_FROM_SHELLFISH (   gene)    GENE_VAL_REG(gene, 10, 12, 12, 2)

Energy from shellfish

Definition at line 54 of file food.c.

#define GENE_ENERGY_FROM_VEGETABLES (   gene)    GENE_VAL_REG(gene, 3, 13, 15, 3)

Various energy use and addition through eating characteristics Energy from vegetables

Definition at line 46 of file food.c.


Function Documentation

n_int food_absorption ( noble_being local,
n_int  max_energy,
n_byte  food_type 
)

How much energy is absorbed from a given type of food.

Parameters:
food_typeThe type of food
localpointer to the ape
Returns:
Energy absorbed

note that the absorbition for different foods is normalised

ingest pathogens from certain foods

< can only eat so much in one go

Definition at line 75 of file food.c.

Here is the call graph for this function:

Here is the caller graph for this function:

n_int food_eat ( n_land local_land,
n_int  loc_x,
n_int  loc_y,
n_int  az,
n_byte food_type,
noble_being local_being 
)

Eat food at the given location and return the energy increase.

Parameters:
simPointer to the simulation
loc_xX ape coordinate
loc_yY ape coordinate
azZ ape coordinate
local_beingPointer to the ape
Returns:
Energy obtained from the food

above the high water mark

in the intertidal zone

Definition at line 278 of file food.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void food_values ( n_land local_land,
n_int  loc_x,
n_int  loc_y,
n_int grass,
n_int trees,
n_int bush 
)

Returns the values for grass, trees and bushes at the given location.

Parameters:
local_landPointer to the land
local_weatherPointer to the weather
loc_xX ape coordinate on the map
loc_yY ape coordinate on the lap
grassReturned value for grass
treesReturned value for trees
bushReturned value for bushes

grass at this location

trees at this location

bushes at this location

Definition at line 155 of file food.c.