Noble Ape
The Central Directories of the Noble Ape Simulation.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
body.c File Reference
#include "entity.h"
#include "entity_internal.h"
Include dependency graph for body.c:

Go to the source code of this file.

Functions

void social_action (noble_simulation *sim, noble_being *local, noble_being *other, n_byte action)
 Performs a given action.
n_int genetics_compare (n_genetics *genetics_a, n_genetics *genetics_b)
 Compares two genetics and returns 1 if they are the same.
void genetics_set (n_genetics *genetics_a, n_genetics *genetics_b)
 Sets genetics A to be the same as genetics B.
void genetics_zero (n_genetics *genetics_a)
 Creates a blank genome.
void body_genetics (noble_being *beings, n_int number, n_genetics *genetics, n_genetics *mother_genetics, n_genetics *father_genetics, n_byte2 *local)
void body_genome (n_byte maternal, n_genetics *genome, n_byte *genome_str)
 Returns a string of letters representing the genome.

Function Documentation

void body_genetics ( noble_being beings,
n_int  number,
n_genetics genetics,
n_genetics mother_genetics,
n_genetics father_genetics,
n_byte2 local 
)

crossover and mutation

Y chromosome does not undergo crossover and passes from father to son

transpose genes between chromosomes

align the sex genetics

Definition at line 911 of file body.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void body_genome ( n_byte  maternal,
n_genetics genome,
n_byte genome_str 
)

Returns a string of letters representing the genome.

Parameters:
maternalShow either the maternal or paternal side of each chromosome
genomeThe genome to be shown
genome_strThe returned string

for every chromosome

for each 2 bit gene in the chromosome. Each chromosome is 16 bits long with the full 32 bit value containing the chromosome pair

the maternal part of the diplod

the paternal part of the diploid

Definition at line 954 of file body.c.

n_int genetics_compare ( n_genetics genetics_a,
n_genetics genetics_b 
)

Compares two genetics and returns 1 if they are the same.

Parameters:
genetics_aFirst genetics
genetics_bSecond genetics
Returns:
1 if the two genetics are the same, 0 otherwise

Definition at line 611 of file body.c.

void genetics_set ( n_genetics genetics_a,
n_genetics genetics_b 
)

Sets genetics A to be the same as genetics B.

Parameters:
genetics_aThe destination genetics
genetics_bThe source genetics

Definition at line 631 of file body.c.

Here is the caller graph for this function:

void genetics_zero ( n_genetics genetics_a)

Creates a blank genome.

Parameters:
genetics_aThe genetics to be cleared

Definition at line 645 of file body.c.

void social_action ( noble_simulation sim,
noble_being local,
noble_being other,
n_byte  action 
)

Performs a given action.

Parameters:
simPointer to the simulation object
localPointer to the being performing the action
otherPointer to another being involved in the action
actionThe type of action

individual action

social action

Definition at line 519 of file body.c.

Here is the call graph for this function:

Here is the caller graph for this function: