Noble Ape
The Central Directories of the Noble Ape Simulation.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
entity_internal.h
Go to the documentation of this file.
1 /****************************************************************
2 
3  entity_internal.h
4 
5  =============================================================
6 
7  Copyright 1996-2014 Tom Barbalet. All rights reserved.
8 
9  Permission is hereby granted, free of charge, to any person
10  obtaining a copy of this software and associated documentation
11  files (the "Software"), to deal in the Software without
12  restriction, including without limitation the rights to use,
13  copy, modify, merge, publish, distribute, sublicense, and/or
14  sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following
16  conditions:
17 
18  The above copyright notice and this permission notice shall be
19  included in all copies or substantial portions of the Software.
20 
21  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  OTHER DEALINGS IN THE SOFTWARE.
29 
30  This software and Noble Ape are a continuing work of Tom Barbalet,
31  begun on 13 June 1996. No apes or cats were harmed in the writing
32  of this software.
33 
34  ****************************************************************/
35 
36 #ifndef NOBLEAPE_ENTITY_INTERNAL_H
37 #define NOBLEAPE_ENTITY_INTERNAL_H
38 
40 {
44 };
45 
46 #define CONSUME_E(being, max_energy, food)
47 
48 /* offsets applied to land operator values */
49 #define OFFSET_GRASS 40
50 #define OFFSET_BUSH 14
51 
52 typedef struct
53 {
61 
62 void body_genetics(noble_being * beings, n_int number, n_genetics * genetics, n_genetics * mother_genetics, n_genetics * father_genetics, n_byte2 * local);
63 
65  n_land * local_land,
66  n_int loc_x,
67  n_int loc_y,
68  n_int az,
69  n_byte * food_type,
70  noble_being * local_being);
71 
72 n_int food_absorption(noble_being * local, n_int max_energy, n_byte food_type);
73 
74 void food_values(n_land * local_land,
75  n_int loc_x,
76  n_int loc_y,
77  n_int *grass, n_int *trees, n_int *bush);
78 
79 n_int genetics_compare(n_genetics * genetics_a, n_genetics * genetics_b);
80 void genetics_set(n_genetics * genetics_a, n_genetics * n_genetics);
81 void genetics_zero(n_genetics * genetics_a);
82 
83 void metabolism_init(noble_being * local_being);
84 void metabolism_cycle(noble_simulation * local_sim, noble_being * local_being);
85 void metabolism_vascular_response(noble_simulation * local_sim, noble_being * local_being, n_int response);
86 void metabolism_eat(noble_being * local_being, n_byte food_type);
87 void metabolism_suckle(noble_simulation * sim,noble_being * child, noble_being * mother);
88 
89 void social_action(
90  noble_simulation * sim,
91  noble_being * meeter_being,
92  noble_being * met_being,
93  n_byte action);
94 n_int social_network(noble_being * meeter_being, noble_being * met_being, n_int distance, noble_simulation *sim);
95 n_int social_set_relationship(noble_being * meeter_being,n_byte relationship,noble_being * met_being,noble_simulation * sim);
97  n_byte relationship,
98  noble_simulation * sim);
99 n_byte social_groom(noble_being * meeter_being, noble_being * met_being, n_int distance, n_int awake, n_byte2 familiarity, noble_simulation * sim);
100 n_byte2 social_squabble(noble_being * meeter_being, noble_being * met_being, n_uint distance, n_int is_female, noble_simulation * sim);
101 n_int social_mate(noble_being * meeter_being, noble_being * met_being, n_int being_index, n_int distance, noble_simulation * sim);
102 n_int social_chat(noble_being * meeter_being, noble_being * met_being, n_int being_index, noble_simulation * sim);
103 void social_goals(noble_being * local);
104 n_int get_noble_social(noble_being * meeter_being, noble_being * met_being, noble_simulation * sim);
105 
107  noble_simulation * local_sim,
108  noble_being * meeter_being,
109  noble_being * met_being);
111  noble_being * local, n_byte event, n_int affect,
112  noble_simulation * local_sim,
113  n_byte2 name1, n_byte2 family1,
114  n_byte2 name2, n_byte2 family2, n_byte2 arg);
115 
116 void episodic_food(noble_simulation * local_sim, noble_being * local, n_int energy, n_byte food_type);
117 
118 void episodic_self(
119  noble_simulation * local_sim,
120  noble_being * local,
121  n_byte event,
122  n_int affect,
123  n_byte2 arg);
124 
125 void episodic_close(
126  noble_simulation * local_sim,
127  noble_being * local,
128  noble_being * other,
129  n_byte event,
130  n_int affect,
131  n_byte2 arg);
132 
134  noble_simulation * local_sim,
135  noble_being * local,
136  noble_being * other,
137  n_byte event,
138  n_int affect,
139  n_byte2 arg);
140 
142  noble_simulation * local_sim,
143  noble_being * local,
144  n_int episode_index,
145  n_byte2 mins_ahead,
146  n_byte args);
147 
149  noble_simulation * local_sim,
150  noble_being * local,
151  noble_being * other);
152 
153 void being_init_braincode(noble_being * local,
154  noble_being * other,
155  n_byte friend_foe,
156  n_byte internal);
157 
159 
160 void being_ingest_pathogen(noble_being * local, n_byte food_type);
161 
162 #endif /* NOBLEAPE_ENTITY_INTERNAL_H */