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

This handles episodic memory. More...

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

Go to the source code of this file.

Functions

void episodic_logging (n_console_output *output_function, n_int social)
void episodic_cycle (noble_simulation *local_sim, noble_being *local_being, void *data)
 Update the episodic memories for a given ape. This is based upon a fading memory model in which older memories are replaced by newer ones. Each memory has an associated affect value indicating its emotional impact, and this fades over time.
n_int episodic_met_being_celebrity (noble_simulation *local_sim, noble_being *meeter_being, noble_being *met_being)
 Returns a celebrity factor based upon how many apes within the episodic memory of the given ape have a similar name to the met ape, and their friend or foe values. This means that initial beliefs about other apes are partly a form of stereotyping.
n_int episodic_first_person_memories_percent (noble_simulation *local_sim, noble_being *local, n_byte intention)
 This returns the percentage of episodic memories or intentions which are first person. Some memories originate from the self and others are acquired from others via chatting.
void episodic_food (noble_simulation *local_sim, noble_being *local, n_int energy, n_byte food_type)
 Remember eating.
void episodic_store_memory (noble_being *local, n_byte event, n_int affect, noble_simulation *local_sim, n_byte2 name1, n_byte2 family1, n_byte2 name2, n_byte2 family2, n_byte2 arg)
 Updates the episodic memory with details about an event.
void episodic_self (noble_simulation *local_sim, noble_being *local, n_byte event, n_int affect, n_byte2 arg)
 Store an episodic memory about the self.
void episodic_close (noble_simulation *local_sim, noble_being *local, noble_being *other, n_byte event, n_int affect, n_byte2 arg)
 Remember an event which occurred between being in close proximity.
void episodic_interaction (noble_simulation *local_sim, noble_being *local, noble_being *other, n_byte event, n_int affect, n_byte2 arg)
 Remember a particular interaction between two beings.
n_byte episodic_intention (noble_simulation *local_sim, noble_being *local, n_int episode_index, n_byte2 mins_ahead, n_byte args)
 Generate an intention. Note that intentions are stored together with episodic memories, with the event type making the difference between a memory about the past and an intention about the future.
n_byte episodic_anecdote (noble_simulation *local_sim, noble_being *local, noble_being *other)
 Copy an episodic memory (an anecdote) from one ape to another during chat.

Detailed Description

This handles episodic memory.

Definition in file episodic.c.


Function Documentation

n_byte episodic_anecdote ( noble_simulation local_sim,
noble_being local,
noble_being other 
)

Copy an episodic memory (an anecdote) from one ape to another during chat.

Parameters:
local_simPointer to the simulation
localPointer to the ape conveying the anecdote
otherPointer to the ape to which the anecdote will be copied
Returns:
Returns 1 if the copy was successful, 0 otherwise

both protagonists must be awake

more likely to make errors while drowsy

mutate with some probability

affect gets exaggerated or downplayed

keep affect within range

find an index within the other episodic memory in which to insert

other ape pays attention to the incoming anecdote

Definition at line 684 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void episodic_close ( noble_simulation local_sim,
noble_being local,
noble_being other,
n_byte  event,
n_int  affect,
n_byte2  arg 
)

Remember an event which occurred between being in close proximity.

Parameters:
local_simPointer to the simulation object
localPointer to the first being
otherPointer to the second being
eventThe type of event
affectAffect value associated with the event
argAny additional argument

Definition at line 556 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void episodic_cycle ( noble_simulation local_sim,
noble_being local_being,
void *  data 
)

Update the episodic memories for a given ape. This is based upon a fading memory model in which older memories are replaced by newer ones. Each memory has an associated affect value indicating its emotional impact, and this fades over time.

The rate of fading is genetically regulated, with different rates for memories with positive and negative affect. This facilitates optimistic/pessimistic and forgetful/memorable type personalities.

The fading memory model may not be strictly realistic, and might be replaced by something else in future.

Parameters:
local_simpointer to the simulation
localpointer to the ape

remove intentions which are outdated

is this my intention, or someone else's?

fade towards EPISODIC_AFFECT_ZERO

negative memories fade

positive memories fade

Definition at line 134 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

n_int episodic_first_person_memories_percent ( noble_simulation local_sim,
noble_being local,
n_byte  intention 
)

This returns the percentage of episodic memories or intentions which are first person. Some memories originate from the self and others are acquired from others via chatting.

Parameters:
local_simpointer to the simulation
localpointer to the ape
intention,:0=episodic memories, 1=intentions
Returns:
percentage in the range 0-100

examine all memories

ratio of intentions to other memories

ratio of first person memories to other memories

Definition at line 265 of file episodic.c.

Here is the call graph for this function:

void episodic_food ( noble_simulation local_sim,
noble_being local,
n_int  energy,
n_byte  food_type 
)

Remember eating.

Parameters:
local_simPointer to the simulation object
localPointer to the being
energyEnergy obtained from food
food_typeThe type of food

Definition at line 498 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

n_byte episodic_intention ( noble_simulation local_sim,
noble_being local,
n_int  episode_index,
n_byte2  mins_ahead,
n_byte  args 
)

Generate an intention. Note that intentions are stored together with episodic memories, with the event type making the difference between a memory about the past and an intention about the future.

Parameters:
local_simPointer to the simulation
localPointer to the ape
episode_indexEpisodic memory array index to use.
mins_aheadThe number of minutes into the future for which the intention will last.
argsAny additional arguments
Returns:
Returns 1 if the update was successful, or 0 otherwise.

increment date by one day

extend the time of an existing intention

if this was someone else's intention it now becomes yours

only certain types of events become intentions

find a memory index to replace

Definition at line 604 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void episodic_interaction ( noble_simulation local_sim,
noble_being local,
noble_being other,
n_byte  event,
n_int  affect,
n_byte2  arg 
)

Remember a particular interaction between two beings.

Parameters:
local_simPointer to the simulation object
localPointer to the being
otherPointer to the being being interacted with
eventThe type of event
affectThe affect associated with the interaction
argAny additional argument

Definition at line 578 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void episodic_logging ( n_console_output output_function,
n_int  social 
)

Definition at line 52 of file episodic.c.

Here is the caller graph for this function:

n_int episodic_met_being_celebrity ( noble_simulation local_sim,
noble_being meeter_being,
noble_being met_being 
)

Returns a celebrity factor based upon how many apes within the episodic memory of the given ape have a similar name to the met ape, and their friend or foe values. This means that initial beliefs about other apes are partly a form of stereotyping.

Parameters:
local_simpointer to the simulation
meeter_beingpointer to the ape
met_beingpointer to another ape
Returns:
celebrity value of the met ape

check all episodic memories of the meeter

check both the meeter and the met ape for each memory

same first name

same family name

if both first name and family name match then increase the celebrity value further

limit within range

Definition at line 207 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void episodic_self ( noble_simulation local_sim,
noble_being local,
n_byte  event,
n_int  affect,
n_byte2  arg 
)

Store an episodic memory about the self.

Parameters:
local_simPointer to the simulation object
localPointer to the being
eventThe type of event
affectAn affect value associated with the event
argAny additional argument

Definition at line 536 of file episodic.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void episodic_store_memory ( noble_being local,
n_byte  event,
n_int  affect,
noble_simulation local_sim,
n_byte2  name1,
n_byte2  family1,
n_byte2  name2,
n_byte2  family2,
n_byte2  arg 
)

Updates the episodic memory with details about an event.

Parameters:
localPointer to the ape
eventThe type of event
affectThe affect value associated with the event
local_simPointer to the simulation
name1Name of the first ape in the memory (meeter)
family1Family name of the first ape in the memory (meeter)
name2Name of the second ape in the memory (met)
family2Family name of the second ape in the memory (met)
argAny additional arguments

Definition at line 517 of file episodic.c.

Here is the caller graph for this function: