Noble Ape
The Central Directories of the Noble Ape Simulation.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
entity.h
Go to the documentation of this file.
1 /****************************************************************
2 
3  entity.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_H
37 #define NOBLEAPE_ENTITY_H
38 
39 #ifndef _WIN32
40 
41 #include "../noble/noble.h"
42 #include "../universe/universe.h"
43 
44 #else
45 
46 #include "..\noble\noble.h"
47 #include "..\universe\universe.h"
48 
49 #endif
50 
51 #define LAND_ON
52 #define WEATHER_ON
53 #undef RANDOM_INITIAL_BRAINCODE
54 #undef SHORT_NAMES
55 #undef FIXED_RANDOM_SIM
56 #undef LARGE_SIM
57 
58 #define EPISODIC_AFFECT_ZERO (16384)
59 
61 {
63  BEING_HUNGRY = (10 * 128),
65 };
66 
67 #define SOCIAL_RESPECT_NORMAL 127
68 
70 {
74 };
75 
76 #define GENEALOGY_ON
77 
79 {
84 };
85 
86 /* if you change this you need to change the corresponding definitions in being_state_description */
87 typedef enum
88 {
103 
104 typedef enum
105 {
150 
152  noble_simulation * sim,
153  noble_being * local_being,
154  n_int * no_of_sensors,
155  n_int * no_of_actuators,
156  n_int * no_of_operators,
157  n_int * no_of_conditionals,
158  n_int * no_of_data);
159 
160 n_int being_memory(noble_simulation * local, n_byte * buffer, n_uint * location, n_int memory_available);
161 
162 #ifdef BRAIN_ON
163 n_byte * being_brain(noble_being * value);
164 #endif
165 
168 
169 n_int being_brainstates(noble_being * value, n_int awake, n_byte2 * states);
170 
172 
173 void being_honor_inc_dec(noble_being * inc, noble_being * dec);
174 
175 void being_honor_swap(noble_being * victor, noble_being * vanquished);
176 
178 
179 void being_unpack_family(n_byte2 name, n_byte * values);
180 
182 
183 void being_set_family_name(noble_being * value, n_byte first, n_byte last);
184 
186 
188 
190 
192 
193 void being_name_simple(noble_being * value, n_string str);
194 
196 
197 void being_set_posture(noble_being * value, n_byte post);
198 
200 
202 
204 
206 
207 void being_delta(noble_being * primary, noble_being * secondary, n_vect2 * delta);
208 void being_set_location(noble_being * value, n_byte2 * from);
209 
210 n_int being_dob(noble_being * value);
211 
213 void being_set_speed(noble_being * value, n_byte sp);
214 
215 void being_facing_towards(noble_being * value, n_vect2 * vector);
216 void being_facing_vector(noble_being * value, n_vect2 * vect, n_int divisor);
217 
219 void being_wander(noble_being * value, n_int wander);
220 
222 
224 
226 
228 n_int being_energy_less_than(noble_being * value, n_int less_than);
229 
230 void being_dead(noble_being * value);
231 void being_living(noble_being * value);
232 
233 void being_energy_delta(noble_being * value, n_int delta);
234 
235 n_int being_drive(noble_being * value, enum drives_definition drive);
236 void being_inc_drive(noble_being * value, enum drives_definition drive);
237 void being_dec_drive(noble_being * value, enum drives_definition drive);
238 void being_reset_drive(noble_being * value, enum drives_definition drive);
239 
241 n_int being_mass(noble_being * value);
242 
243 enum inventory_type being_carried(noble_being * value, enum BODY_INVENTORY_TYPES location);
244 void being_drop(noble_being * value, enum BODY_INVENTORY_TYPES location);
245 void being_take(noble_being * value, enum BODY_INVENTORY_TYPES location, enum inventory_type object);
246 
247 void being_listen(noble_simulation * sim, noble_being * local, void * data);
248 
249 #ifdef BRAINCODE_ON
252 #endif
253 
254 typedef void (being_loop_fn)(noble_simulation * sim, noble_being * actual, void * data);
255 
256 void being_loop_no_thread(noble_simulation * sim, noble_being * being_not, being_loop_fn bf_func, void * data);
257 void being_loop(noble_simulation * sim, being_loop_fn bf_func, n_int beings_per_thread);
258 
259 void being_remove_external_set(n_int value);
261 
262 void metabolism_vascular_description(n_int index, n_string description);
264 n_int metabolism_vascular_radius(noble_being * local_being, n_int vessel_index);
265 
266 void being_name_byte2(n_byte2 first, n_byte2 family, n_string name);
267 n_int being_init(n_land * land, noble_being * beings, n_int number, noble_being * local, noble_being * mother,
268  n_byte2* random_factor);
269 void being_erase(noble_being * value);
270 
271 n_uint being_affect(noble_simulation * local_sim, noble_being * local, n_byte is_positive);
272 
273 void episodic_cycle(noble_simulation * local_sim, noble_being * local, void * data);
274 
275 void being_cycle_awake(noble_simulation * sim, noble_being * local);
276 void being_cycle_universal(noble_simulation * sim, noble_being * local, n_byte awake);
277 
278 void drives_cycle(noble_simulation * local_sim, noble_being * local_being, void * data);
279 
280 void being_state_description(n_byte2 state, n_string result);
281 
282 void being_set_state(noble_being * value, being_state_type state);
283 void being_add_state(noble_being * value, being_state_type state);
285 
287 
290 
291 n_int being_name_comparison(noble_being * value, n_byte2 gender_name, n_byte2 family_name);
292 
294  noble_simulation * local_sim,
295  noble_being * local_being,
296  n_int social_graph_index,
297  n_byte met, n_string name);
298 
300  noble_simulation * local_sim,
301  noble_being * local,
302  n_byte intention);
303 
304 void being_immune_transmit(noble_being * meeter_being, noble_being * met_being, n_byte transmission_type);
305 void body_genome(n_byte maternal, n_genetics * genome, n_byte * genome_str);
306 
307 void being_relationship_description(n_int index, n_string description);
309 
310 void brain_dialogue(
311  noble_simulation * sim,
312  n_byte awake,
313  noble_being * meeter_being,
314  noble_being * met_being,
315  n_byte * bc0,
316  n_byte * bc1,
318 
319 void brain_cycle(n_byte * local, n_byte2 * constants);
321 
322 void being_remove(noble_simulation * local_sim);
323 
324 void brain_three_byte_command(n_string string, n_byte * response);
325 
326 void brain_sentence(n_string string, n_byte * response);
327 
329  noble_being * local_being,
330  n_int index,
331  n_string description);
332 
333 void episodic_logging(n_console_output * output_function, n_int social);
334 
336 noble_being * being_find_name(noble_simulation * sim, n_byte2 first_gender, n_byte2 family);
337 void being_move(noble_being * local, n_int vel, n_byte kind);
338 void being_change_selected(noble_simulation * sim, n_byte forwards);
340 
341 n_byte being_los(n_land * land, noble_being * local, n_byte2 lx, n_byte2 ly);
342 
343 void speak_out(n_string filename, n_string paragraph);
344 
345 void social_conception(noble_being * female,
346  noble_being * male,
347  noble_simulation * sim);
348 
349 void social_initial_loop(noble_simulation * local, noble_being * local_being, void * data);
350 
351 void social_secondary_loop(noble_simulation * local, noble_being * local_being, void * data);
352 
353 void being_tidy_loop(noble_simulation * local_sim, noble_being * local_being, void * data);
354 
355 void being_recalibrate_honor_loop(noble_simulation * local, noble_being * value, void * data);
356 
357 void being_remove_loop1(noble_simulation * local_sim, noble_being * local_being, void * data);
358 
359 typedef struct{
365 
366 void being_remove_loop2(noble_simulation * local_sim, noble_being * local, void * data);
367 
369 
371 
373 
374 void being_remains(noble_simulation * sim, noble_being * dead);
375 
377 
378 #endif /* NOBLEAPE_ENTITY_H */