Exemplo n.º 1
0
/*    MAIN PROGRAM     */
int main(int argc, char** argv)
{
  int  next_event;
  char keytoclose = 'p';

  if(!startup_check(0))
    return -1;

  /* Initialize csiglib and simulation */
  while (initialize(argc, (const char * *)argv)) {;

  /* Schedule beginning of simulation */
  event_time = current_time;
  event_type = RUN_event;
  schedule_event();

  /* Schedule end of simulation */
  event_time = stop_time;
  event_type = run_end_event;
  event_priority = 9999;
  schedule_event();

/*  EVENT EXECUTION CONTROL LOOP */
  while (!run_error && !done) {
    /* Pull next event from event list */
    next_event = c_timing();

    /* increment the event count for this event */
    event_count[next_event]++;

    /* Call appropriate event routine */
    switch ( next_event ) {
      case run_end_event:  run_end();
               break;

      case RUN_event:  RUN();
               event_trace("RUN",event_count[next_event]);
               break;

      case ARRIVE_event:  ARRIVE();
               event_trace("ARRIVE",event_count[next_event]);
               break;

      case STFCFC_event:  STFCFC();
               event_trace("STFCFC",event_count[next_event]);
               break;

      case FINFCFC_event:  FINFCFC();
               event_trace("FINFCFC",event_count[next_event]);
               break;

      case STFCE_event:  STFCE();
               event_trace("STFCE",event_count[next_event]);
               break;

      case FINFCE_event:  FINFCE();
               event_trace("FINFCE",event_count[next_event]);
               break;

      case STEE_event:  STEE();
               event_trace("STEE",event_count[next_event]);
               break;

      case FINEE_event:  FINEE();
               event_trace("FINEE",event_count[next_event]);
               break;

      case SETSRVR_event:  SETSRVR();
               event_trace("SETSRVR",event_count[next_event]);
               break;

      case ADDECON_event:  ADDECON();
               event_trace("ADDECON",event_count[next_event]);
               break;

      case ADDFC_event:  ADDFC();
               event_trace("ADDFC",event_count[next_event]);
               break;

      case ASSIGN_event:  ASSIGN();
               event_trace("ASSIGN",event_count[next_event]);
               break;

      }
    }
  }
// experiments terminated
printf("Experiments ended! If runs end early: \n\r1. check fields in *.exp file. \n\r2. check if output file was already open. \n\r");
return 0;
}
Exemplo n.º 2
0
/*    MAIN PROGRAM     */
int main(int argc, char** argv)
{
  int  next_event;
  char keytoclose = 'p';

  if(!startup_check(0))
    return -1;

  /* Initialize csiglib and simulation */
  while (initialize(argc, (const char * *)argv)) {;

  /* Schedule beginning of simulation */
  event_time = current_time;
  event_type = RUN_event;
  schedule_event();

  /* Schedule end of simulation */
  event_time = stop_time;
  event_type = run_end_event;
  event_priority = 9999;
  schedule_event();

/*  EVENT EXECUTION CONTROL LOOP */
  while (!run_error && !done) {
    /* Pull next event from event list */
    next_event = c_timing();

    /* increment the event count for this event */
    event_count[next_event]++;

    /* Call appropriate event routine */
    switch ( next_event ) {
      case run_end_event:  run_end();
               break;

      case RUN_event:  RUN();
               event_trace("RUN",event_count[next_event]);
               break;

      case CUSTM_event:  CUSTM();
               event_trace("CUSTM",event_count[next_event]);
               break;

      case RENT_event:  RENT();
               event_trace("RENT",event_count[next_event]);
               break;

      case RETURN_event:  RETURN();
               event_trace("RETURN",event_count[next_event]);
               break;

      case FAIL_event:  FAIL();
               event_trace("FAIL",event_count[next_event]);
               break;

      case FIX_event:  FIX();
               event_trace("FIX",event_count[next_event]);
               break;

      case INPUT_event:  INPUT();
               event_trace("INPUT",event_count[next_event]);
               break;

      case WALKIN_event:  WALKIN();
               event_trace("WALKIN",event_count[next_event]);
               break;

      case RETIRE_event:  RETIRE();
               event_trace("RETIRE",event_count[next_event]);
               break;

      case LVE_event:  LVE();
               event_trace("LVE",event_count[next_event]);
               break;

      case RESERV_event:  RESERV();
               event_trace("RESERV",event_count[next_event]);
               break;

      case RSVP_event:  RSVP();
               event_trace("RSVP",event_count[next_event]);
               break;

      case costs_event:  costs();
               event_trace("costs",event_count[next_event]);
               break;

      }
    }
  }
// experiments terminated
printf("Experiments ended! If runs end early: \n\r1. check fields in *.exp file. \n\r2. check if output file was already open. \n\r");
return 0;
}