65 extern struct argp model_argp;
69 int RandomRange(
int min,
int max);
70 int RandomRangeNonUniform(
int x,
int min,
int max);
71 double Expent(
double mean);
75 int Zipf(
double skew,
int limit);
78 extern
void (*
ScheduleNewEvent)(
unsigned int receiver,
simtime_t timestamp,
unsigned int event_type,
void *event_content,
unsigned int event_size);
79 extern
void SetState(
void *new_state);
135 const char *
const topology_path;
138 const unsigned out_of_topology;
139 const bool write_enabled;
168 unsigned int FindReceiver (
void);
171 unsigned int RegionsCount (
void);
174 unsigned int DirectionsCount (
void);
177 unsigned int NeighboursCount (
unsigned int region);
180 unsigned int GetReceiver (
unsigned int from, direction_t direction,
bool reachable);
183 unsigned int FindReceiverToward (
unsigned int to);
187 double ComputeMinTour (
unsigned int source,
unsigned int dest,
unsigned int result[RegionsCount()]);
193 typedef unsigned long long agent_t;
196 const unsigned neighbour_data_size;
197 const unsigned traverse_handler;
198 const bool keep_history;
201 int GetNeighbourInfo (direction_t i,
unsigned int *region_id,
void **data_p);
202 void TrackNeighbourInfo (
void *neighbour_data);
204 bool IterAgents (agent_t *agent_p);
205 unsigned CountAgents (
void);
207 agent_t SpawnAgent (
unsigned user_data_size);
208 void KillAgent (agent_t agent);
210 void* DataAgent (agent_t agent,
unsigned *data_size_p);
212 void ScheduleNewLeaveEvent (
simtime_t time,
unsigned int event_type, agent_t agent);
214 unsigned CountVisits (
const agent_t agent);
215 void GetVisit (
const agent_t agent,
unsigned *region_p,
unsigned *event_type_p,
unsigned i);
216 void SetVisit (
const agent_t agent,
unsigned region,
unsigned event_type,
unsigned i);
217 void EnqueueVisit (agent_t agent,
unsigned region,
unsigned event_type);
218 void AddVisit (agent_t agent,
unsigned region,
unsigned event_type,
unsigned i);
219 void RemoveVisit (agent_t agent,
unsigned i);
221 unsigned CountPastVisits (
const agent_t agent);
222 void GetPastVisit (
const agent_t agent,
unsigned *region_p,
unsigned *event_type_p,
simtime_t *time_p,
unsigned i);
all crossing costs and probabilities are set to 1, but there can be not crossable regions ...
unsigned int n_prc_tot
This is the definition of the number of LPs running in the current simulation.
#define min(a, b)
Macro to find the minimum among two values.
double Expent(double mean)
A generic invalid direction.
double GetValueTopology(unsigned from, unsigned to)
a torus shaped grid topology (a wrapping around square topology)
double simtime_t
This defines the type with whom timestamps are represented.
void SetValueTopology(unsigned from, unsigned to, double value)
decisions are taken at random but are weighted on the palatability of neighbours
__attribute((weak)) extern struct argp model_argp
This can be implemented by the model for smart argument handling.
enum _direction_t direction_t
void(* ScheduleNewEvent)(unsigned int receiver, simtime_t timestamp, unsigned int event_type, void *event_content, unsigned int event_size)
This is the function pointer to correctly set ScheduleNewEvent API version, depending if we're runnin...
#define max(a, b)
Macro to find the maximum among two values.
an arbitrary shaped topology
a ring shaped topology direction
arbitrary offset used to distinguish during debug different enums
decisions on next hops are taken based on the costs undertaken to cross the boundaries ...
a ring shaped topology walkable in a single direction
void SetState(void *new_state)
int Zipf(double skew, int limit)