36 #define CONSOLE_REQUIRED
42 #include "../entity/entity.h"
44 #include "..\entity\entity.h"
160 "preference_mate_height_male",
161 "preference_mate_height_female",
162 "preference_mate_pigment_male",
163 "preference_mate_pigment_female",
164 "preference_mate_hair_male",
165 "preference_mate_hair_female",
166 "preference_mate_frame_male",
167 "preference_mate_frame_female",
168 "preference_groom_male",
169 "preference_groom_female",
170 "preference_anecdote_event",
171 "preference_anecdote_affect",
174 "attention_actor_index",
175 "attention_episode_index",
176 "attention_body_index",
182 "shout_family_first",
185 "social_graph_location_x",
186 "social_graph_location_y",
189 "social_graph_attraction",
191 "social_graph_familiarity",
192 "social_graph_first_name",
193 "social_graph_family_first",
194 "social_graph_family_last",
200 "memory_first_name_zero",
201 "memory_family_first_zero",
202 "memory_family_last_zero",
203 "memory_first_name_one",
204 "memory_family_first_one",
205 "memory_family_last_one",
221 static n_int sim_new_progress = 0;
225 return sim_new_progress;
230 static n_int sim_quit_value = 0;
231 static pthread_t threads[2] = {0};
232 static n_byte threads_running[2] = {0};
236 return sim_quit_value;
239 static void sim_console_clean_up(
void)
255 static void *sim_thread_posix(
void *threadid)
260 sim_console_clean_up();
273 if ((threads_running[0] == 0)||(threads_running[1] == 0))
278 if (threads_running[loop] == 0)
280 threads_running[loop] = 1;
281 pthread_create(&threads[loop], 0L, sim_thread_posix, &threads_running[loop]);
333 if (local_brain != 0L)
368 if (
being_awake(local_sim, local_being) == 0)
return;
379 if (
being_awake(local_sim, local_being) == 0)
return;
381 if (interpret == 0L)
return;
384 local_sim->
beings, local_being,
417 being_loop(&sim, sim_being_universal_loop, 32);
471 #define MINIMAL_ALLOCATION (sizeof(n_land)+(MAP_AREA)+(2*HI_RES_MAP_AREA)+(HI_RES_MAP_AREA/8)+(512*512)+(TERRAIN_WINDOW_AREA)+(sizeof(noble_being) * MIN_BEINGS)+1+(sizeof(noble_simulation)))
473 #define MAXIMUM_ALLOCATION (MINIMAL_ALLOCATION + (sizeof(noble_being) * 200))
477 local->
land = (
n_land *) & buffer[ *location ];
478 *location +=
sizeof(
n_land);
489 n_uint current_location = 0;
494 return SHOW_ERROR(
"Not enough memory to run");
499 current_location = offscreen_size;
501 sim_memory_land(&sim,
offbuffer, ¤t_location);
503 sim_memory_remains(&sim,
offbuffer, ¤t_location);
505 memory_allocated = memory_allocated - offscreen_size - current_location;
514 sim_new_progress = 1;
533 #ifdef FIXED_RANDOM_SIM
534 randomise = FIXED_RANDOM_SIM;
538 if (sim_memory(offscreen_size) != 0)
546 local_random[0] = (
n_byte2)(randomise >> 16) & 0xffff;
547 local_random[1] = (
n_byte2)(randomise & 0xffff);
573 while (sim.
num < count_to)
576 if((sim.
num + 1) < sim.
max)
594 sim_new_progress = 0;
605 sim_console_clean_up();
639 while (loop < sim.
num)