#include "proj.h"



//  BusRoute  = "BusRoute:" 
//           <name > RouteName 
//           "total" 
//           "route" 
//           "length" 
//           ":" 
//           <totalLength > RouteLen 
//           "consisting" 
//           "of" 
//           "bus" 
//           "stops" 
//           ":" 
//           <busStops > BusStop_List 
//           "with" 
//           "assigned" 
//           "busses" 
//           ":" 
//           <buses > Bus_List .
void BusRoute::simulate(  )
{
  DEM_TRACE("BusRoute","void BusRoute::simulate()");
  // variables for carrying in and out
  BusRoute*  busRoute =  this ;

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_buses()->simulate( busRoute  );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::simulate( BusRoute*  busRoute )
{
  DEM_TRACE("Bus","void Bus::simulate(BusRoute*  busRoute)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

     StopId *stopId = this->get_currentStop();
     if (stopId != NULL) {
       // waiting at a stop
       this->drop_passengers(stopId);
       this->load_passengers( busRoute->find_stop(stopId) );
       this->set_currentStop(NULL);   // prepare to move
     }	
     else {
       // moving along the route
       int prevPos = this->get_loc();
       int nextPos = (prevPos + this->get_spd()) % busRoute->get_len();
       BusStop *stop = busRoute->any_stop_around(prevPos, nextPos);
       if (stop == NULL)
	 this->proceed_to(nextPos);
       else if (this->have_stop_request( stop->get_id() )) {
	 this->proceed_to( stop->get_loc() );
	 this->set_currentStop( stop->get_id() );   // stop here
       }
       else {
	 int have_room = this->get_cap() - this->count_passengers(); 
	 if ( have_room && stop->anybody_waiting() ) {
	   this->proceed_to( stop->get_loc() );
	   this->set_currentStop( stop->get_id() );   // stop here
	 }
	 else
	   this->proceed_to(nextPos);
       }
     }
    

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

//  Bus_List  ~  { Bus  }. .
void Bus_List::simulate( BusRoute*  busRoute )
{
  DEM_TRACE("Bus_List","void Bus_List::simulate(BusRoute*  busRoute)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  Bus_list_iterator	next_Bus(*this);
  Bus*		each_Bus;

  while ( each_Bus = next_Bus() )
  {
  // repetition edge prefix wrappers
    each_Bus->simulate( busRoute  );
  // repetition edge suffix wrappers
  }

  // suffix class wrappers

  // assignments for carrying out
}

//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::drop_passengers( StopId*  iStopId )
{
  DEM_TRACE("Bus","void Bus::drop_passengers(StopId*  iStopId)");
  // variables for carrying in and out
  Person_List*  newPasList =  new Person_List() ;

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_passengers()->drop_passengers( iStopId , newPasList  );
  // construction edge suffix wrappers

  // suffix class wrappers
 this->set_passengers(newPasList); 

  // assignments for carrying out
}

//  Person  = <id > PersonId 
//         "destination:" 
//         <destination > StopId .
void Person::drop_passengers( StopId*  iStopId, Person_List* &  newPasList )
{
  DEM_TRACE("Person","void Person::drop_passengers(StopId*  iStopId,Person_List* &  newPasList)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

     if (!iStopId->g_equal( this->get_destination() )) 
       newPasList->append(this);
     

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

//  Person_List  ~  { Person  }. .
void Person_List::drop_passengers( StopId*  iStopId, Person_List* &  newPasList )
{
  DEM_TRACE("Person_List","void Person_List::drop_passengers(StopId*  iStopId,Person_List* &  newPasList)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  Person_list_iterator	next_Person(*this);
  Person*		each_Person;

  while ( each_Person = next_Person() )
  {
  // repetition edge prefix wrappers
    each_Person->drop_passengers( iStopId , newPasList  );
  // repetition edge suffix wrappers
  }

  // suffix class wrappers

  // assignments for carrying out
}

//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::load_passengers( BusStop*  iStop )
{
  DEM_TRACE("Bus","void Bus::load_passengers(BusStop*  iStop)");
  // variables for carrying in and out
  Person_List*  newPasList ;

  // assignments for carrying in

  // prefix class wrappers

     int allowance = this->get_cap() - this->count_passengers();
     newPasList = iStop->give_passengers(allowance);
     

  // outgoing calls
  // construction edge prefix wrappers
  this->get_passengers()->load_passengers( iStop , newPasList  );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  Person_List  ~  { Person  }. .
void Person_List::load_passengers( BusStop*  iStop, Person_List*  newPasList )
{
  DEM_TRACE("Person_List","void Person_List::load_passengers(BusStop*  iStop,Person_List*  newPasList)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 this->concatenate(newPasList); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

BusStop*  BusRoute::find_stop( StopId*  iStopId )
{
  DEM_TRACE("BusRoute","BusStop*  BusRoute::find_stop(StopId*  iStopId)");
  BusStop*  return_val =  NULL ;

  this->find_stop_( return_val, iStopId  );
  return return_val;
}
//  BusRoute  = "BusRoute:" 
//           <name > RouteName 
//           "total" 
//           "route" 
//           "length" 
//           ":" 
//           <totalLength > RouteLen 
//           "consisting" 
//           "of" 
//           "bus" 
//           "stops" 
//           ":" 
//           <busStops > BusStop_List 
//           "with" 
//           "assigned" 
//           "busses" 
//           ":" 
//           <buses > Bus_List .
void BusRoute::find_stop_( BusStop* & return_val, StopId*  iStopId )
{
  DEM_TRACE("BusRoute","void BusRoute::find_stop_(BusStop* & return_val,StopId*  iStopId)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_busStops()->find_stop_( return_val, iStopId  );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  BusStop  = <id > StopId 
//          "at:" 
//          <location > RouteLoc 
//          "with" 
//          "waiting" 
//          "list" 
//          ":" 
//          <waitingList > Person_List .
void BusStop::find_stop_( BusStop* & return_val, StopId*  iStopId )
{
  DEM_TRACE("BusStop","void BusStop::find_stop_(BusStop* & return_val,StopId*  iStopId)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

     if (iStopId->g_equal( this->get_id() ))
       return_val = this;
     

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

//  BusStop_List  ~  { BusStop  }. .
void BusStop_List::find_stop_( BusStop* & return_val, StopId*  iStopId )
{
  DEM_TRACE("BusStop_List","void BusStop_List::find_stop_(BusStop* & return_val,StopId*  iStopId)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  BusStop_list_iterator	next_BusStop(*this);
  BusStop*		each_BusStop;

  while ( each_BusStop = next_BusStop() )
  {
  // repetition edge prefix wrappers
 if (return_val) return; 
    each_BusStop->find_stop_( return_val, iStopId  );
  // repetition edge suffix wrappers
  }

  // suffix class wrappers

  // assignments for carrying out
}

int Bus::count_passengers(  )
{
  DEM_TRACE("Bus","int Bus::count_passengers()");
  int return_val;

  this->count_passengers_( return_val );
  return return_val;
}
//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::count_passengers_( int& return_val )
{
  DEM_TRACE("Bus","void Bus::count_passengers_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_passengers()->count_passengers_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  Person_List  ~  { Person  }. .
void Person_List::count_passengers_( int& return_val )
{
  DEM_TRACE("Person_List","void Person_List::count_passengers_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 return_val = this->list_length(); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

Person_List*  BusStop::give_passengers( int allowance )
{
  DEM_TRACE("BusStop","Person_List*  BusStop::give_passengers(int allowance)");
  Person_List*  return_val =  new Person_List() ;

  this->give_passengers_( return_val, allowance  );
  return return_val;
}
//  BusStop  = <id > StopId 
//          "at:" 
//          <location > RouteLoc 
//          "with" 
//          "waiting" 
//          "list" 
//          ":" 
//          <waitingList > Person_List .
void BusStop::give_passengers_( Person_List* & return_val, int allowance )
{
  DEM_TRACE("BusStop","void BusStop::give_passengers_(Person_List* & return_val,int allowance)");
  // variables for carrying in and out
  Person_List*  newWaitList =  new Person_List() ;

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_waitingList()->give_passengers_( return_val, allowance , newWaitList  );
  // construction edge suffix wrappers

  // suffix class wrappers
 this->set_waitingList(newWaitList); 

  // assignments for carrying out
}

//  Person  = <id > PersonId 
//         "destination:" 
//         <destination > StopId .
void Person::give_passengers_( Person_List* & return_val, int allowance, Person_List* &  newWaitList )
{
  DEM_TRACE("Person","void Person::give_passengers_(Person_List* & return_val,int allowance,Person_List* &  newWaitList)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 
     if (return_val->list_length() < allowance)
       return_val->append(this);
     else
       newWaitList->append(this);
     

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

//  Person_List  ~  { Person  }. .
void Person_List::give_passengers_( Person_List* & return_val, int allowance, Person_List* &  newWaitList )
{
  DEM_TRACE("Person_List","void Person_List::give_passengers_(Person_List* & return_val,int allowance,Person_List* &  newWaitList)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  Person_list_iterator	next_Person(*this);
  Person*		each_Person;

  while ( each_Person = next_Person() )
  {
  // repetition edge prefix wrappers
    each_Person->give_passengers_( return_val, allowance , newWaitList  );
  // repetition edge suffix wrappers
  }

  // suffix class wrappers

  // assignments for carrying out
}

BusStop*  BusRoute::any_stop_around( int prevPos,int nextPos )
{
  DEM_TRACE("BusRoute","BusStop*  BusRoute::any_stop_around(int prevPos,int nextPos)");
  BusStop*  return_val =  NULL ;

  this->any_stop_around_( return_val, prevPos ,  nextPos  );
  return return_val;
}
//  BusRoute  = "BusRoute:" 
//           <name > RouteName 
//           "total" 
//           "route" 
//           "length" 
//           ":" 
//           <totalLength > RouteLen 
//           "consisting" 
//           "of" 
//           "bus" 
//           "stops" 
//           ":" 
//           <busStops > BusStop_List 
//           "with" 
//           "assigned" 
//           "busses" 
//           ":" 
//           <buses > Bus_List .
void BusRoute::any_stop_around_( BusStop* & return_val, int prevPos,int nextPos )
{
  DEM_TRACE("BusRoute","void BusRoute::any_stop_around_(BusStop* & return_val,int prevPos,int nextPos)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_busStops()->any_stop_around_( return_val, prevPos ,  nextPos  );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  BusStop  = <id > StopId 
//          "at:" 
//          <location > RouteLoc 
//          "with" 
//          "waiting" 
//          "list" 
//          ":" 
//          <waitingList > Person_List .
void BusStop::any_stop_around_( BusStop* & return_val, int prevPos,int nextPos )
{
  DEM_TRACE("BusStop","void BusStop::any_stop_around_(BusStop* & return_val,int prevPos,int nextPos)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 
     int stopLoc = this->get_loc();
     if (prevPos < nextPos) {
       if ((stopLoc > prevPos) && (stopLoc <= nextPos))
         return_val = this;
     }
     else if ((stopLoc > prevPos) || (stopLoc <= nextPos))
       return_val = this;
     

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

//  BusStop_List  ~  { BusStop  }. .
void BusStop_List::any_stop_around_( BusStop* & return_val, int prevPos,int nextPos )
{
  DEM_TRACE("BusStop_List","void BusStop_List::any_stop_around_(BusStop* & return_val,int prevPos,int nextPos)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  BusStop_list_iterator	next_BusStop(*this);
  BusStop*		each_BusStop;

  while ( each_BusStop = next_BusStop() )
  {
  // repetition edge prefix wrappers
 if (return_val) return; 
    each_BusStop->any_stop_around_( return_val, prevPos ,  nextPos  );
  // repetition edge suffix wrappers
  }

  // suffix class wrappers

  // assignments for carrying out
}

//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::proceed_to( int newPos )
{
  DEM_TRACE("Bus","void Bus::proceed_to(int newPos)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_position()->proceed_to( newPos  );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  RouteLoc  = <v > DemNumber 
//           "ft" .
void RouteLoc::proceed_to( int newPos )
{
  DEM_TRACE("RouteLoc","void RouteLoc::proceed_to(int newPos)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 this->get_v()->set_val(newPos); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

int Bus::have_stop_request( StopId*  iStopId )
{
  DEM_TRACE("Bus","int Bus::have_stop_request(StopId*  iStopId)");
  int return_val =  0 ;

  this->have_stop_request_( return_val, iStopId  );
  return return_val;
}
//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::have_stop_request_( int& return_val, StopId*  iStopId )
{
  DEM_TRACE("Bus","void Bus::have_stop_request_(int& return_val,StopId*  iStopId)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_passengers()->have_stop_request_( return_val, iStopId  );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  Person  = <id > PersonId 
//         "destination:" 
//         <destination > StopId .
void Person::have_stop_request_( int& return_val, StopId*  iStopId )
{
  DEM_TRACE("Person","void Person::have_stop_request_(int& return_val,StopId*  iStopId)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

     if (iStopId->g_equal( this->get_destination() ))
       return_val = 1;
     

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

//  Person_List  ~  { Person  }. .
void Person_List::have_stop_request_( int& return_val, StopId*  iStopId )
{
  DEM_TRACE("Person_List","void Person_List::have_stop_request_(int& return_val,StopId*  iStopId)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  Person_list_iterator	next_Person(*this);
  Person*		each_Person;

  while ( each_Person = next_Person() )
  {
  // repetition edge prefix wrappers
 if (return_val) return; 
    each_Person->have_stop_request_( return_val, iStopId  );
  // repetition edge suffix wrappers
  }

  // suffix class wrappers

  // assignments for carrying out
}

int BusStop::anybody_waiting(  )
{
  DEM_TRACE("BusStop","int BusStop::anybody_waiting()");
  int return_val =  0 ;

  this->anybody_waiting_( return_val );
  return return_val;
}
//  BusStop  = <id > StopId 
//          "at:" 
//          <location > RouteLoc 
//          "with" 
//          "waiting" 
//          "list" 
//          ":" 
//          <waitingList > Person_List .
void BusStop::anybody_waiting_( int& return_val )
{
  DEM_TRACE("BusStop","void BusStop::anybody_waiting_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_waitingList()->anybody_waiting_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  Person_List  ~  { Person  }. .
void Person_List::anybody_waiting_( int& return_val )
{
  DEM_TRACE("Person_List","void Person_List::anybody_waiting_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 return_val = this->empty(); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

int BusRoute::get_len(  )
{
  DEM_TRACE("BusRoute","int BusRoute::get_len()");
  int return_val;

  this->get_len_( return_val );
  return return_val;
}
//  BusRoute  = "BusRoute:" 
//           <name > RouteName 
//           "total" 
//           "route" 
//           "length" 
//           ":" 
//           <totalLength > RouteLen 
//           "consisting" 
//           "of" 
//           "bus" 
//           "stops" 
//           ":" 
//           <busStops > BusStop_List 
//           "with" 
//           "assigned" 
//           "busses" 
//           ":" 
//           <buses > Bus_List .
void BusRoute::get_len_( int& return_val )
{
  DEM_TRACE("BusRoute","void BusRoute::get_len_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_totalLength()->get_len_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  RouteLen  = <v > DemNumber 
//           "ft" .
void RouteLen::get_len_( int& return_val )
{
  DEM_TRACE("RouteLen","void RouteLen::get_len_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 return_val = this->get_v()->get_val(); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

int Bus::get_loc(  )
{
  DEM_TRACE("Bus","int Bus::get_loc()");
  int return_val;

  this->get_loc_( return_val );
  return return_val;
}
int BusStop::get_loc(  )
{
  DEM_TRACE("BusStop","int BusStop::get_loc()");
  int return_val;

  this->get_loc_( return_val );
  return return_val;
}
//  BusStop  = <id > StopId 
//          "at:" 
//          <location > RouteLoc 
//          "with" 
//          "waiting" 
//          "list" 
//          ":" 
//          <waitingList > Person_List .
void BusStop::get_loc_( int& return_val )
{
  DEM_TRACE("BusStop","void BusStop::get_loc_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_location()->get_loc_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::get_loc_( int& return_val )
{
  DEM_TRACE("Bus","void Bus::get_loc_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_position()->get_loc_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  RouteLoc  = <v > DemNumber 
//           "ft" .
void RouteLoc::get_loc_( int& return_val )
{
  DEM_TRACE("RouteLoc","void RouteLoc::get_loc_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 return_val = this->get_v()->get_val(); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

int Bus::get_cap(  )
{
  DEM_TRACE("Bus","int Bus::get_cap()");
  int return_val;

  this->get_cap_( return_val );
  return return_val;
}
//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::get_cap_( int& return_val )
{
  DEM_TRACE("Bus","void Bus::get_cap_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_capacity()->get_cap_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  BusCapac  = <v > DemNumber 
//           "passengers" .
void BusCapac::get_cap_( int& return_val )
{
  DEM_TRACE("BusCapac","void BusCapac::get_cap_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 return_val = this->get_v()->get_val(); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}

int Bus::get_spd(  )
{
  DEM_TRACE("Bus","int Bus::get_spd()");
  int return_val;

  this->get_spd_( return_val );
  return return_val;
}
//  Bus  = <id > BusId 
//      "at:" 
//      <position > RouteLoc 
//       [ <currentStop > StopId  ] 
//      "capacity:" 
//      <capacity > BusCapac 
//      "speed:" 
//      <speed > BusSpeed 
//      "carrying" 
//      "passenger(s)" 
//      ":" 
//      <passengers > Person_List .
void Bus::get_spd_( int& return_val )
{
  DEM_TRACE("Bus","void Bus::get_spd_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers

  // outgoing calls
  // construction edge prefix wrappers
  this->get_speed()->get_spd_( return_val );
  // construction edge suffix wrappers

  // suffix class wrappers

  // assignments for carrying out
}

//  BusSpeed  = <v > DemNumber 
//           "ft/min" .
void BusSpeed::get_spd_( int& return_val )
{
  DEM_TRACE("BusSpeed","void BusSpeed::get_spd_(int& return_val)");
  // variables for carrying in and out

  // assignments for carrying in

  // prefix class wrappers
 return_val = this->get_v()->get_val(); 

  // outgoing calls

  // suffix class wrappers

  // assignments for carrying out
}


