Noble Ape
The Central Directories of the Noble Ape Simulation.
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
entity
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
60
enum
being_energy
61
{
62
BEING_DEAD
= 0,
63
BEING_HUNGRY
= (10 * 128),
64
BEING_FULL
= (
BEING_HUNGRY
* 3)
65
};
66
67
#define SOCIAL_RESPECT_NORMAL 127
68
69
enum
BRAINPROBE_TYPE
70
{
71
INPUT_SENSOR
= 0,
72
OUTPUT_ACTUATOR
,
73
NUMBER_BRAINPROBE_TYPES
74
};
75
76
#define GENEALOGY_ON
77
78
enum
GENEALOGY_FORMAT
79
{
80
GENEALOGY_NONE
= 0,
81
GENEALOGY_GENXML
,
82
GENEALOGY_GEDCOM
,
83
GENEALOGY_FORMATS
84
};
85
86
/* if you change this you need to change the corresponding definitions in being_state_description */
87
typedef
enum
88
{
89
BEING_STATE_ASLEEP
= 0,
90
BEING_STATE_AWAKE
= 1,
91
BEING_STATE_HUNGRY
= 2,
92
BEING_STATE_SWIMMING
= 4,
93
BEING_STATE_EATING
= 8,
94
BEING_STATE_MOVING
= 16,
95
BEING_STATE_SPEAKING
= 32,
96
BEING_STATE_SHOUTING
= 64,
97
BEING_STATE_GROOMING
= 128,
98
BEING_STATE_SUCKLING
= 256,
99
BEING_STATE_SHOWFORCE
= 512,
100
BEING_STATE_ATTACK
= 1024,
101
BEING_STATES
= 12
102
}
being_state_type
;
103
104
typedef
enum
105
{
106
EVENT_EAT
= 1,
107
EVENT_MATE
,
108
EVENT_HIT
,
109
EVENT_HIT_BY
,
110
EVENT_SWIM
,
111
EVENT_GROOM
,
112
EVENT_GROOMED
,
113
EVENT_CHAT
,
114
EVENT_SHOUT
,
115
EVENT_BIRTH
,
116
EVENT_CARRIED
,
117
EVENT_CARRIED_BY
,
118
EVENT_SUCKLED
,
119
EVENT_SUCKLED_BY
,
120
EVENT_SEEK_MATE
,
121
EVENT_WHACKED
,
122
EVENT_WHACKED_BY
,
123
EVENT_HURLED
,
124
EVENT_HURLED_BY
,
125
EVENT_HUGGED
,
126
EVENT_HUGGED_BY
,
127
EVENT_PRODDED
,
128
EVENT_PRODDED_BY
,
129
EVENT_DRAG
,
130
EVENT_BRANDISH
,
131
EVENT_DROP
,
132
EVENT_PICKUP
,
133
EVENT_GIVEN
,
134
EVENT_GIVEN_BY
,
135
EVENT_CHEW
,
136
EVENT_BASH_OBJECTS
,
137
EVENT_FISH
,
138
EVENT_SMILED
,
139
EVENT_SMILED_BY
,
140
EVENT_GLOWERED
,
141
EVENT_GLOWERED_BY
,
142
EVENT_PATTED
,
143
EVENT_PATTED_BY
,
144
EVENT_POINT
,
145
EVENT_POINTED
,
146
EVENT_TICKLED
,
147
EVENT_TICKLED_BY
,
148
EVENTS
149
}
being_episodic_event_type
;
150
151
void
braincode_number_of_instructions
(
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
166
noble_episodic
*
being_episodic
(
noble_being
* value);
167
noble_social
*
being_social
(
noble_being
* value);
168
169
n_int
being_brainstates
(
noble_being
* value,
n_int
awake,
n_byte2
* states);
170
171
n_byte
being_honor
(
noble_being
* value);
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
177
n_int
being_honor_compare
(
noble_being
* first,
noble_being
* second);
178
179
void
being_unpack_family
(
n_byte2
name,
n_byte
* values);
180
181
n_byte
being_first_name
(
noble_being
* value);
182
183
void
being_set_family_name
(
noble_being
* value,
n_byte
first,
n_byte
last);
184
185
n_byte
being_family_first_name
(
noble_being
* value);
186
187
n_byte
being_family_second_name
(
noble_being
* value);
188
189
n_byte2
being_gender_name
(
noble_being
* value);
190
191
n_byte2
being_family_name
(
noble_being
* value);
192
193
void
being_name_simple
(
noble_being
* value,
n_string
str);
194
195
n_byte
being_posture
(
noble_being
* value);
196
197
void
being_set_posture
(
noble_being
* value,
n_byte
post);
198
199
n_int
being_posture_under
(
noble_being
* value,
enum
posture_type
post);
200
201
n_int
being_location_x
(
noble_being
* value);
202
203
n_int
being_location_y
(
noble_being
* value);
204
205
n_byte2
*
being_location
(
noble_being
* value);
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
212
n_byte
being_speed
(
noble_being
* value);
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
218
n_byte
being_facing
(
noble_being
* value);
219
void
being_wander
(
noble_being
* value,
n_int
wander);
220
221
n_genetics
*
being_genetics
(
noble_being
* value);
222
223
n_int
being_pregnant
(
noble_being
* value);
224
225
n_genetics
*
being_fetal_genetics
(
noble_being
* value);
226
227
n_int
being_energy
(
noble_being
* value);
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
240
n_int
being_height
(
noble_being
* value);
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
250
n_byte
*
being_braincode_external
(
noble_being
* value);
251
n_byte
*
being_braincode_internal
(
noble_being
* value);
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);
260
n_int
being_remove_internal
(
void
);
261
262
void
metabolism_vascular_description
(
n_int
index,
n_string
description);
263
n_string
metabolism_description
(
n_int
index);
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);
284
n_byte2
being_state
(
noble_being
* value);
285
286
n_byte2
being_random
(
noble_being
* value);
287
288
void
being_set_select_name
(
noble_simulation
* sim,
n_string
name);
289
n_string
being_get_select_name
(
noble_simulation
* sim);
290
291
n_int
being_name_comparison
(
noble_being
* value,
n_byte2
gender_name,
n_byte2
family_name);
292
293
void
social_graph_link_name
(
294
noble_simulation
* local_sim,
295
noble_being
* local_being,
296
n_int
social_graph_index,
297
n_byte
met,
n_string
name);
298
299
n_int
episodic_first_person_memories_percent
(
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);
308
n_string
being_body_inventory_description
(
n_int
index);
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,
317
n_int
being_index
);
318
319
void
brain_cycle
(
n_byte
* local,
n_byte2
* constants);
320
noble_being
*
being_from_name
(
noble_simulation
* sim,
n_string
name);
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
328
n_int
episode_description
(
noble_simulation
* sim,
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
335
n_uint
social_respect_mean
(
noble_simulation
* sim,
noble_being
*local_being);
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);
339
n_byte
being_awake
(
noble_simulation
* sim,
noble_being
* local);
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
{
360
noble_being
*
being_count
;
361
noble_being
*
reference
;
362
n_int
selected_died
;
363
n_uint
count
;
364
}
being_remove_loop2_struct
;
365
366
void
being_remove_loop2
(
noble_simulation
* local_sim,
noble_being
* local,
void
* data);
367
368
being_remove_loop2_struct
*
being_remove_initial
(
noble_simulation
* local_sim);
369
370
void
being_remove_final
(
noble_simulation
* local_sim,
being_remove_loop2_struct
** brls);
371
372
void
being_remains_init
(
noble_simulation
* sim);
373
374
void
being_remains
(
noble_simulation
* sim,
noble_being
* dead);
375
376
n_int
being_index
(
noble_simulation
* sim,
noble_being
* local);
377
378
#endif
/* NOBLEAPE_ENTITY_H */
Generated on Tue Oct 14 2014 20:57:38 for Noble Ape by
1.8.1.1