|
Noble Ape
The Central Directories of the Noble Ape Simulation.
|
This handles social interactions and management of the social graph. More...
Go to the source code of this file.
Macros | |
| #define | GENE_STATUS_PREFERENCE(gene) GENE_VAL_REG(gene, 15, 12, 10, 1) |
| #define | GENE_PIGMENTATION_PREFERENCE(gene) GENE_VAL_REG(gene, 5, 3, 11, 4) |
| #define | GENE_HEIGHT_PREFERENCE(gene) GENE_VAL_REG(gene, 9, 8, 14, 10) |
| #define | GENE_FRAME_PREFERENCE(gene) GENE_VAL_REG(gene, 9, 0, 8, 2) |
| #define | GENE_HAIR_PREFERENCE(gene) GENE_VAL_REG(gene, 10, 7, 14, 15) |
| #define | GENE_GROOM(gene) GENE_VAL_REG(gene, 14, 2, 5, 10) |
| #define | GENE_AGGRESSION(gene) GENE_VAL_REG(gene, 11, 3, 5, 0) |
| #define | GENE_MATE_BOND(gene) GENE_VAL_REG(gene, 10, 2, 4, 0) |
| #define | GENE_INCEST_AVERSION(gene) GENE_VAL_REG(gene, 10, 8, 4, 9) |
| #define | GENE_LATENT_ENERGY_USE(gene) GENE_VAL_REG(gene, 14, 3, 6, 10) |
Functions | |
| void | social_graph_link_name (noble_simulation *local_sim, noble_being *local_being, n_int social_graph_index, n_byte met, n_string name) |
| Returns a string for the name of the ape in the given social graph array index. | |
| n_int | get_noble_social (noble_being *meeter_being, noble_being *met_being, noble_simulation *sim) |
| If two beings have previously met return the social graph index. | |
| n_int | social_get_relationship (noble_being *meeter_being, n_byte relationship, noble_simulation *sim) |
| Returns the social graph index of the given relationship type. This can be used for example to search for the father of an ape within the social graph. | |
| n_int | social_set_relationship (noble_being *meeter_being, n_byte relationship, noble_being *met_being, noble_simulation *sim) |
| Set the relationship type between two apes. | |
| n_int | social_network (noble_being *meeter_being, noble_being *met_being, n_int distance, noble_simulation *sim) |
| When two apes meet within a given maximum range this updates the social graph of both. | |
| n_byte | social_groom (noble_being *meeter_being, noble_being *met_being, n_int distance, n_int awake, n_byte2 familiarity, noble_simulation *sim) |
| Grooming behavior. | |
| n_byte2 | social_squabble (noble_being *meeter_being, noble_being *met_being, n_uint distance, n_int is_female, noble_simulation *sim) |
| Squabbling and fighting. | |
| n_uint | social_respect_mean (noble_simulation *sim, noble_being *local_being) |
| Returns the average friend or foe value. | |
| void | social_conception (noble_being *female, noble_being *male, noble_simulation *sim) |
| Update for a conception event. This stores the date, details of the father and resets drives and goals. | |
| n_int | social_mate (noble_being *meeter_being, noble_being *met_being, n_int being_index, n_int distance, noble_simulation *sim) |
| Mating behavior. | |
| n_int | social_chat (noble_being *meeter_being, noble_being *met_being, n_int being_index, noble_simulation *sim) |
| Dialogue between beings. | |
| void | social_goals (noble_being *local) |
| Goal oriented behavior. | |
| void | social_initial_loop (noble_simulation *local, noble_being *local_being, void *data) |
| void | social_secondary_loop (noble_simulation *local, noble_being *local_being, void *data) |
This handles social interactions and management of the social graph.
Definition in file social.c.
| #define GENE_AGGRESSION | ( | gene | ) | GENE_VAL_REG(gene, 11, 3, 5, 0) |
| #define GENE_FRAME_PREFERENCE | ( | gene | ) | GENE_VAL_REG(gene, 9, 0, 8, 2) |
| #define GENE_GROOM | ( | gene | ) | GENE_VAL_REG(gene, 14, 2, 5, 10) |
| #define GENE_HAIR_PREFERENCE | ( | gene | ) | GENE_VAL_REG(gene, 10, 7, 14, 15) |
| #define GENE_HEIGHT_PREFERENCE | ( | gene | ) | GENE_VAL_REG(gene, 9, 8, 14, 10) |
| #define GENE_INCEST_AVERSION | ( | gene | ) | GENE_VAL_REG(gene, 10, 8, 4, 9) |
| #define GENE_LATENT_ENERGY_USE | ( | gene | ) | GENE_VAL_REG(gene, 14, 3, 6, 10) |
| #define GENE_MATE_BOND | ( | gene | ) | GENE_VAL_REG(gene, 10, 2, 4, 0) |
| #define GENE_PIGMENTATION_PREFERENCE | ( | gene | ) | GENE_VAL_REG(gene, 5, 3, 11, 4) |
| #define GENE_STATUS_PREFERENCE | ( | gene | ) | GENE_VAL_REG(gene, 15, 12, 10, 1) |
| n_int get_noble_social | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| noble_simulation * | sim | ||
| ) |
If two beings have previously met return the social graph index.
| meeter_being | Pointer to the ape doing the meeting |
| met_being | Pointer to the ape being met |
| sim | Pointer to the simulation |
Definition at line 752 of file social.c.
| n_int social_chat | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_int | being_index, | ||
| noble_simulation * | sim | ||
| ) |
Dialogue between beings.
| meeter_being | Pointer to the being doing the meeting |
| met_being | Pointer to the being which is being met |
| being_index | Array index for the met individual within the social graph of the meeter |
| sim | Pointer to the simulation |
agree upon terrirory
do I respect their views ?
pick one of the individuals from their graph
ask about an individual we're searching for
what type of family relationship is currently being attended to
choose randomly
have I already met this individual?
was already met
update this being's belief
belief about location
belief about state
if we have never met then add to my graph as someone I've "heard of". This is like a prior expectation or second hand information. The least familiar relationship is replaced
if this is a family member of the previously unknown being then make sure that the family member type is set to OTHER - i.e. not my family someone else's
initialise the braincode
Definition at line 1601 of file social.c.
| void social_conception | ( | noble_being * | female, |
| noble_being * | male, | ||
| noble_simulation * | sim | ||
| ) |
Update for a conception event. This stores the date, details of the father and resets drives and goals.
| female | Pointer to the mother |
| male | Pointer to the father |
| today | The current date |
| sim | Pointer to the simulation |
store the date of conception
reset sex drive and goal
remember the event
Definition at line 1367 of file social.c.
| n_int social_get_relationship | ( | noble_being * | meeter_being, |
| n_byte | relationship, | ||
| noble_simulation * | sim | ||
| ) |
Returns the social graph index of the given relationship type. This can be used for example to search for the father of an ape within the social graph.
| meeter_being | Pointer to the ape |
| relationship | The type of relationship to search for |
| sim | Pointer to the simulation |
get the social graph
Search the social graph
Is this the desired relationship type?
Definition at line 977 of file social.c.
| void social_goals | ( | noble_being * | local | ) |
Goal oriented behavior.
| local | Pointer to the ape |
| loc_f | The direction facing |
move towards a location
are we there yet?
destination reached - goal cancelled
clear any script override
decrement the goal counter
timed out
Definition at line 1765 of file social.c.
| void social_graph_link_name | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| n_int | social_graph_index, | ||
| n_byte | met, | ||
| n_string | name | ||
| ) |
Returns a string for the name of the ape in the given social graph array index.
| local_sim | Pointer to the simulation |
| localbeing | Pinter to the ape |
| social_graph_index | Array index within the social graph |
| met | BEING_MEETER=return name for the meeter, BEING_MET=return name for the met |
| name | Returned ape name |
Get the social graph for the being
Definition at line 479 of file social.c.
| n_byte social_groom | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_int | distance, | ||
| n_int | awake, | ||
| n_byte2 | familiarity, | ||
| noble_simulation * | sim | ||
| ) |
Grooming behavior.
| meeter_being | Pointer to the ape doing the meeting |
| met_being | Pointer to the ape being met |
| distance | Distance between the apes |
| awake | Whether the met being is awake |
| familiarity | Familiarity with the met ape |
| sim | Pointer to the simulation |
hairy beings can carry more parasites
acquire parasites from the environment with some low probability, and existing parasites multiply
parasites sap energy
hairy beings can carry more parasites
parasite transmission - e.g. flea hop
social grooming removes parasites and alters social status relationships
is the groomee female?
grooming preference
individuals which are familiar tend to groom more often
transmit pathogens via touch
pick a body location to groom
groomed wounds disappear
grooming location becomes the new focus of attention
the two beings meet and become more friendly
Alter social status relations. The groomer gains status, since they are providing a service
Decrement parasites
Definition at line 1075 of file social.c.
| void social_initial_loop | ( | noble_simulation * | local, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| n_int social_mate | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_int | being_index, | ||
| n_int | distance, | ||
| noble_simulation * | sim | ||
| ) |
Mating behavior.
| meeter_being | Pointer to the ape doing the meeting |
| met_being | Pointer to the ape whi is being met |
| today | The current date |
| being_index | Array index for the met individual within the social graph of the meeter |
| distance | The Distance between the two apes |
| sim | Pointer to the simulation |
mating is probabilistic, with a bias towards higher status individuals
attractiveness based upon various criteria
some minimum level of attraction required for pair bonding
transmit pathogens
check opposite sexes
< '=' : conversion from 'n_int' to 'n_byte', possible loss of data
Definition at line 1425 of file social.c.
| n_int social_network | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_int | distance, | ||
| noble_simulation * | sim | ||
| ) |
When two apes meet within a given maximum range this updates the social graph of both.
| meeter_being | Pointer to the ape doing the meeting |
| met_being | Pointer to the ape being met |
| distance | Distance between the apes |
| sim | Pointer to the simulation |
Definition at line 1051 of file social.c.
| n_uint social_respect_mean | ( | noble_simulation * | sim, |
| noble_being * | local_being | ||
| ) |
Returns the average friend or foe value.
| sim | Pointer to the simulation |
| local_being | Pointer to the ape |
note that this includes the self
Definition at line 1332 of file social.c.
| void social_secondary_loop | ( | noble_simulation * | local, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| n_int social_set_relationship | ( | noble_being * | meeter_being, |
| n_byte | relationship, | ||
| noble_being * | met_being, | ||
| noble_simulation * | sim | ||
| ) |
Set the relationship type between two apes.
| meeter_being | Pointer to the ape doing the meeting |
| relationship | The type of relationship |
| met_being | Pointer to the ape being met |
| sim | Pointer to the simulation |
no relationship specified
create the social graph entry if necessary and return its array index
get the social graph
set the relationship type
Definition at line 1013 of file social.c.
| n_byte2 social_squabble | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_uint | distance, | ||
| n_int | is_female, | ||
| noble_simulation * | sim | ||
| ) |
Squabbling and fighting.
| meeter_being | Pointer to the ape doing the meeting |
| met_being | Pointer to the ape being met |
| distance | Distance between the apes |
| is_female | Whether the met being is female |
| sim | Pointer to the simulation |
distance between beings
battle with rival families
high ranking apes will more aggressively defend their honor
females are less agressive (less testosterone)
who is the strongest ?
victor disrespects the vanquished
vanquished disrespects the victor
victor increases in honor
vanquished decreases in honor
show of force
attack
remember the fight
vanquished turns away
vanquished flees
Definition at line 1212 of file social.c.
1.8.1.1