|
Noble Ape
The Central Directories of the Noble Ape Simulation.
|
Go to the source code of this file.
Data Structures | |
| struct | being_remove_loop2_struct |
Macros | |
| #define | LAND_ON |
| #define | WEATHER_ON |
| #define | EPISODIC_AFFECT_ZERO (16384) |
| #define | SOCIAL_RESPECT_NORMAL 127 |
| #define | GENEALOGY_ON |
Typedefs | |
| typedef void( | being_loop_fn )(noble_simulation *sim, noble_being *actual, void *data) |
| typedef void( being_loop_fn)(noble_simulation *sim, noble_being *actual, void *data) |
| enum being_energy |
| enum being_state_type |
| enum BRAINPROBE_TYPE |
| enum GENEALOGY_FORMAT |
| void being_add_state | ( | noble_being * | value, |
| being_state_type | state | ||
| ) |
| n_uint being_affect | ( | noble_simulation * | local_sim, |
| noble_being * | local, | ||
| n_byte | is_positive | ||
| ) |
| n_byte being_awake | ( | noble_simulation * | sim, |
| noble_being * | local | ||
| ) |
This checks to see if the Noble Ape is awake
| sim | The simulation pointer |
| reference | The specific Noble Ape checked for being awake |
if it is not night, the being is fully awake
if it night the being is...
... fully awake to swim
... slightly awake to eat
... slightly awake to slow down
... asleep
Definition at line 2076 of file being.c.
| n_byte* being_brain | ( | noble_being * | value | ) |
| n_byte* being_braincode_external | ( | noble_being * | value | ) |
| n_byte* being_braincode_internal | ( | noble_being * | value | ) |
| n_int being_brainstates | ( | noble_being * | value, |
| n_int | awake, | ||
| n_byte2 * | states | ||
| ) |
| enum inventory_type being_carried | ( | noble_being * | value, |
| enum BODY_INVENTORY_TYPES | location | ||
| ) |
| void being_change_selected | ( | noble_simulation * | sim, |
| n_byte | forwards | ||
| ) |
| void being_cycle_awake | ( | noble_simulation * | sim, |
| noble_being * | local | ||
| ) |
tmp_speed is the optimum speed based on the gradient
delta_energy is the energy required for movement
amount of body fat in kg
If it sees water in the distance then turn
horizontally oriented posture
When swimming drop everything except what's on your head or back. Note that the groomed flag is also cleared
swimming proficiency
bathing removes parasites
adjust speed using genetics
is the being to which we are paying attention within view?
Find the closest beings
eating when stopped
remember eating
grow
orient towards a goal
a certain time after giving birth females become receptive again
zero value indicates ready to conceive
A mother could have multiple children, so only find the youngest
Birth
mother carries the child
Compute the mass of the unborn child. This will be added to the mass of the mother
child follows the mother
orient towards the mother
suckling
child moves from back to front
sucking causes loss of grooming
hungry mothers stop producing milk
mother loses energy
child gains energy
set child state to suckling
child acquires immunity from mother
no longer carrying the child
rescale familiarity values
Definition at line 2698 of file being.c.
| void being_cycle_universal | ( | noble_simulation * | sim, |
| noble_being * | local, | ||
| n_byte | awake | ||
| ) |
| void being_dead | ( | noble_being * | value | ) |
| void being_dec_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| void being_delta | ( | noble_being * | primary, |
| noble_being * | secondary, | ||
| n_vect2 * | delta | ||
| ) |
| n_int being_dob | ( | noble_being * | value | ) |
| n_int being_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| void being_drop | ( | noble_being * | value, |
| enum BODY_INVENTORY_TYPES | location | ||
| ) |
| n_int being_energy | ( | noble_being * | value | ) |
| void being_energy_delta | ( | noble_being * | value, |
| n_int | delta | ||
| ) |
| n_int being_energy_less_than | ( | noble_being * | value, |
| n_int | less_than | ||
| ) |
| noble_episodic* being_episodic | ( | noble_being * | value | ) |
| void being_erase | ( | noble_being * | value | ) |
| n_byte being_facing | ( | noble_being * | value | ) |
| void being_facing_towards | ( | noble_being * | value, |
| n_vect2 * | vector | ||
| ) |
| void being_facing_vector | ( | noble_being * | value, |
| n_vect2 * | vect, | ||
| n_int | divisor | ||
| ) |
| n_byte being_family_first_name | ( | noble_being * | value | ) |
| n_byte2 being_family_name | ( | noble_being * | value | ) |
| n_byte being_family_second_name | ( | noble_being * | value | ) |
| n_genetics* being_fetal_genetics | ( | noble_being * | value | ) |
| noble_being* being_find_name | ( | noble_simulation * | sim, |
| n_byte2 | first_gender, | ||
| n_byte2 | family | ||
| ) |
| n_byte being_first_name | ( | noble_being * | value | ) |
| noble_being* being_from_name | ( | noble_simulation * | sim, |
| n_string | name | ||
| ) |
return the being array index with the given name
| sim | Pointer to the simulation object |
| name | Name of the being |
Definition at line 738 of file being.c.
| n_byte2 being_gender_name | ( | noble_being * | value | ) |
| n_genetics* being_genetics | ( | noble_being * | value | ) |
| n_string being_get_select_name | ( | noble_simulation * | sim | ) |
| n_int being_height | ( | noble_being * | value | ) |
| n_byte being_honor | ( | noble_being * | value | ) |
| n_int being_honor_compare | ( | noble_being * | first, |
| noble_being * | second | ||
| ) |
| void being_honor_inc_dec | ( | noble_being * | inc, |
| noble_being * | dec | ||
| ) |
| void being_honor_swap | ( | noble_being * | victor, |
| noble_being * | vanquished | ||
| ) |
| void being_immune_transmit | ( | noble_being * | meeter_being, |
| noble_being * | met_being, | ||
| n_byte | transmission_type | ||
| ) |
| void being_inc_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| n_int being_index | ( | noble_simulation * | sim, |
| noble_being * | local | ||
| ) |
| n_int being_init | ( | n_land * | land, |
| noble_being * | beings, | ||
| n_int | number, | ||
| noble_being * | local, | ||
| noble_being * | mother, | ||
| n_byte2 * | random_factor | ||
| ) |
Initialise the ape's variables and clear its brain
| sim | Pointer to the simulation object |
| mother | Pointer to the mother |
| random_factor | Random seed |
this is the being to be born
Set learned preferences to 0.5 (no preference in either direction. This may seem like tabla rasa, but there are genetic biases
clear the generation numbers for mother and father
initially seed the brain with instructions which are genetically biased
has no social connections initially
default type of entity
friend_or_foe can be positive or negative, with SOCIAL_RESPECT_NORMAL as the zero point
randomly initialize registers
initialize brainprobes
this is the same as equals
ascribed social status
produce an initial distribution of heights and masses
These magic numbers were found in March 2001 - feel free to change them!
Definition at line 3287 of file being.c.
| void being_listen | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| void being_living | ( | noble_being * | value | ) |
| n_byte2* being_location | ( | noble_being * | value | ) |
| n_int being_location_x | ( | noble_being * | value | ) |
| n_int being_location_y | ( | noble_being * | value | ) |
| void being_loop | ( | noble_simulation * | sim, |
| being_loop_fn | bf_func, | ||
| n_int | beings_per_thread | ||
| ) |
| void being_loop_no_thread | ( | noble_simulation * | sim, |
| noble_being * | being_not, | ||
| being_loop_fn | bf_func, | ||
| void * | data | ||
| ) |
| n_byte being_los | ( | n_land * | land, |
| noble_being * | local, | ||
| n_byte2 | lx, | ||
| n_byte2 | ly | ||
| ) |
This checks to see if a Noble Ape can see a particular point
| sim | The simulation pointer |
| reference | The specific Noble Ape checked for being awake |
| lx | The x location of the point to be seen. |
| ly | The y location of the point to be seen. |
Definition at line 783 of file being.c.
| n_int being_mass | ( | noble_being * | value | ) |
| n_int being_memory | ( | noble_simulation * | local, |
| n_byte * | buffer, | ||
| n_uint * | location, | ||
| n_int | memory_available | ||
| ) |
| void being_move | ( | noble_being * | local, |
| n_int | rel_vel, | ||
| n_byte | kind | ||
| ) |
This moves the specified Noble Ape outside the core simulation movement interface - think mouse movement or keyboard movement.
| local | The pointer to the noble_being being moved. |
| rel_vel | The movement variable used - historically the velocity hence the variable name. |
| kind | The kind of movement used - 0 = turning around pivoting on the z-axis (ie a standing turn), 1 = move forwards or backwards based on the direction facing, 2 = cursor like movements along the X and Y axis useful when operating the arrow keys (but not much else). |
Definition at line 2010 of file being.c.
| n_int being_name_comparison | ( | noble_being * | value, |
| n_byte2 | gender_name, | ||
| n_byte2 | family_name | ||
| ) |
| void being_name_simple | ( | noble_being * | value, |
| n_string | str | ||
| ) |
| n_byte being_posture | ( | noble_being * | value | ) |
| n_int being_posture_under | ( | noble_being * | value, |
| enum posture_type | post | ||
| ) |
| n_int being_pregnant | ( | noble_being * | value | ) |
| n_byte2 being_random | ( | noble_being * | value | ) |
| void being_recalibrate_honor_loop | ( | noble_simulation * | local, |
| noble_being * | value, | ||
| void * | data | ||
| ) |
| void being_remains | ( | noble_simulation * | sim, |
| noble_being * | dead | ||
| ) |
| void being_remains_init | ( | noble_simulation * | sim | ) |
| void being_remove | ( | noble_simulation * | local_sim | ) |
| void being_remove_final | ( | noble_simulation * | local_sim, |
| being_remove_loop2_struct ** | brls | ||
| ) |
| being_remove_loop2_struct* being_remove_initial | ( | noble_simulation * | local_sim | ) |
| void being_remove_loop1 | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| void being_remove_loop2 | ( | noble_simulation * | local_sim, |
| noble_being * | local, | ||
| void * | data | ||
| ) |
| void being_reset_drive | ( | noble_being * | value, |
| enum drives_definition | drive | ||
| ) |
| void being_set_family_name | ( | noble_being * | value, |
| n_byte | first, | ||
| n_byte | last | ||
| ) |
| void being_set_location | ( | noble_being * | value, |
| n_byte2 * | from | ||
| ) |
| void being_set_posture | ( | noble_being * | value, |
| n_byte | post | ||
| ) |
| void being_set_select_name | ( | noble_simulation * | sim, |
| n_string | name | ||
| ) |
| void being_set_speed | ( | noble_being * | value, |
| n_byte | sp | ||
| ) |
| void being_set_state | ( | noble_being * | value, |
| being_state_type | state | ||
| ) |
| noble_social* being_social | ( | noble_being * | value | ) |
| n_byte being_speed | ( | noble_being * | value | ) |
| n_byte2 being_state | ( | noble_being * | value | ) |
| void being_take | ( | noble_being * | value, |
| enum BODY_INVENTORY_TYPES | location, | ||
| enum inventory_type | object | ||
| ) |
| void being_tidy_loop | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
the more body fat, the less energy is lost whilst swimming
going uphill
hairy creatures are better insulated
this simulates natural death or at least some trauma the ape may or may not be able to recover from
Definition at line 3557 of file being.c.
| void being_wander | ( | noble_being * | value, |
| n_int | wander | ||
| ) |
| void body_genome | ( | n_byte | maternal, |
| n_genetics * | genome, | ||
| n_byte * | genome_str | ||
| ) |
Returns a string of letters representing the genome.
| maternal | Show either the maternal or paternal side of each chromosome |
| genome | The genome to be shown |
| genome_str | The 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
| void brain_dialogue | ( | noble_simulation * | sim, |
| n_byte | awake, | ||
| noble_being * | meeter_being, | ||
| noble_being * | met_being, | ||
| n_byte * | bc0, | ||
| n_byte * | bc1, | ||
| n_int | being_index | ||
| ) |
Two beings meet and chat, or a being engages in an internal dialogue.
| sim | Pointer to the simulation object |
| awake | Whether the being is awake |
| meeter_being | Pointer to the being doing the meeting |
| met_being | Pointer to the being which was met |
| bc0 | Braincode of the meeter |
| bc1 | Braincode of the met |
| being_index | Social graph index of the being which is the current focus of attention |
fixed number of itterations for internal dialogue
variable number of itterations for chat
clear episodes visited. This array helps to avoid repeatedly visiting the same memories
General sensor
Shift attention to a different actor
store the current focus of attention
Shift attention to a different episode
Shift attention to a different territory
Shift attention to a body region
Shift attention to a similar location
Shift attention to a similar time
Shift attention to a similar date
Shift attention to a similar name
Shift attention to a similar affect
atmosphere pressure
wind magnitude
attention to body
territory name
territory familiarity
territory familiarity
carrying object
shift attention to a given social graph entry based on relationship
store the current focus of attention
shift attention to a different relationship type
store the current relationship attention
If attention has shifted to a new episode
Shift attention to the being in this episode
store the change in attention
set territory attention to the location where the episode occurred
Action
individual or social action
Set location goal
alter friend or foe value
alter attraction
alter familiarity
The values 10 and 20 meetings were just found experimentally
brainprobe frequency
brainprobe address
shout out
volume of message
type of message
intention
brainprobe offset
posture
brainprobe position
alter learned preferences
spread anecdote
not internal dialogue
avoid repeated anecdotes in the same conversation
Definition at line 1152 of file brain.c.
| void braincode_number_of_instructions | ( | noble_simulation * | sim, |
| noble_being * | local_being, | ||
| n_int * | no_of_sensors, | ||
| n_int * | no_of_actuators, | ||
| n_int * | no_of_operators, | ||
| n_int * | no_of_conditionals, | ||
| n_int * | no_of_data | ||
| ) |
| void drives_cycle | ( | noble_simulation * | local_sim, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
Update biological drives.
| local | Pointer to the ape |
| beings_in_vicinity | The number of other apes within the vicinity |
| awake | Whether the ape is awake |
| sim | Pointer to the simulation |
Definition at line 287 of file drives.c.
| n_int episode_description | ( | noble_simulation * | sim, |
| noble_being * | local_being, | ||
| n_int | index, | ||
| n_string | description | ||
| ) |
| 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.
| local_sim | pointer to the simulation |
| local | pointer 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.
| 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.
| local_sim | pointer to the simulation |
| local | pointer to the ape |
| intention,: | 0=episodic memories, 1=intentions |
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.
| void episodic_logging | ( | n_console_output * | output_function, |
| n_int | social | ||
| ) |
| n_int metabolism_vascular_radius | ( | noble_being * | local_being, |
| n_int | vessel_index | ||
| ) |
| 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.
| 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.
| void social_initial_loop | ( | noble_simulation * | local, |
| noble_being * | local_being, | ||
| void * | data | ||
| ) |
| 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 | ||
| ) |
1.8.1.1