46 Tom, David, Jeremy, Ron,
50 Marilyn, Carolyn, Cathy,
51 Inez, Jean, Heather, Juliet
53 const int noOfEmployees = Juliet+1;
65 const char* employeeToName(
Employee e);
66 extern const int stewards[];
67 extern const int noOfStewards;
68 extern const int hostesses[];
69 extern const int noOfHostesses;
70 extern const int spanishSpeaking[];
71 extern const int noOfSpanishSpeaking;
72 extern const int frenchSpeaking[];
73 extern const int noOfFrenchSpeaking;
74 extern const int germanSpeaking[];
75 extern const int noOfGermanSpeaking;
76 extern const Flight requiredCrew[];
77 extern const int noOfFlights;
97 :
Script(
opt), flight(*this,noOfFlights,
IntSet::empty,0,noOfEmployees-1) {
98 IntSet stewardsDS(stewards,noOfStewards);
99 IntSet hostessesDS(hostesses,noOfHostesses);
100 IntSet spanishDS(spanishSpeaking, noOfSpanishSpeaking);
101 IntSet frenchDS(frenchSpeaking, noOfFrenchSpeaking);
102 IntSet germanDS(germanSpeaking, noOfGermanSpeaking);
104 for (
int i=0;
i<noOfFlights;
i++) {
110 requiredCrew[
i].stewards);
112 requiredCrew[
i].hostesses);
114 requiredCrew[
i].spanish);
116 requiredCrew[
i].french);
118 requiredCrew[
i].german);
122 for (
int i=0;
i<noOfFlights-2;
i++) {
123 rel(*
this, flight[
i] || flight[
i+1]);
124 rel(*
this, flight[
i] || flight[
i+2]);
126 rel(*
this, flight[noOfFlights-2] || flight[noOfFlights-1]);
134 for (
int i=0;
i<noOfFlights;
i++) {
135 os <<
"\tFlight " <<
i+1 <<
":" << std::endl;
136 os <<
"\t\tCrew\tStew.\tHost.\tFrench\tSpanish\tGerman"
137 << std::endl <<
"\t";
138 os <<
"\t" << requiredCrew[
i].staff <<
"\t" << requiredCrew[
i].stewards
139 <<
"\t" << requiredCrew[
i].hostesses <<
"\t"
140 << requiredCrew[
i].spanish
141 <<
"\t" << requiredCrew[
i].french <<
"\t" << requiredCrew[
i].german
144 os <<
"\t\tSchedule:" << std::endl <<
"\t\t";
147 os << employeeToName(static_cast<Employee>(
d.val())) <<
" ";
150 os <<
"\tRequired: ";
152 os << employeeToName(static_cast<Employee>(
d.val())) <<
" ";
154 os << std::endl <<
"\t\t\tPossible: ";
156 os << employeeToName(static_cast<Employee>(
d.val())) <<
" ";
159 os << std::endl << std::endl;
171 return new Crew(*
this);
184 Script::run<Crew,DFS,Options>(o);
194 case Tom :
return "Tom";
195 case David :
return "David";
196 case Jeremy:
return "Jeremy";
197 case Ron:
return "Ron";
198 case Joe:
return "Joe";
199 case Bill:
return "Bill";
200 case Fred:
return "Fred";
201 case Bob:
return "Bob";
202 case Mario:
return "Mario";
203 case Ed:
return "Ed";
204 case Carol:
return "Carol";
205 case Janet:
return "Janet";
206 case Tracy:
return "Tracy";
207 case Marilyn:
return "Marilyn";
208 case Carolyn:
return "Carolyn";
209 case Cathy:
return "Cathy";
210 case Inez:
return "Inez";
211 case Jean:
return "Jean";
212 case Heather:
return "Heather";
213 case Juliet:
return "Juliet";
220 const int stewards[] =
221 {Tom, David, Jeremy, Ron, Joe, Bill, Fred, Bob, Mario, Ed};
223 const int noOfStewards =
sizeof(stewards) /
sizeof(
int);
225 const int hostesses[] =
226 { Carol, Janet, Tracy, Marilyn, Carolyn, Cathy, Inez,
227 Jean, Heather, Juliet };
229 const int noOfHostesses =
sizeof(hostesses) /
sizeof(
int);
231 const int frenchSpeaking[] =
232 { Bill, Inez, Jean, Juliet };
234 const int noOfFrenchSpeaking =
sizeof(frenchSpeaking) /
sizeof(
int);
236 const int germanSpeaking[] =
237 { Tom, Jeremy, Mario, Cathy, Juliet };
239 const int noOfGermanSpeaking =
sizeof(germanSpeaking) /
sizeof(
int);
241 const int spanishSpeaking[] =
242 { Joe, Bill, Fred, Mario, Marilyn, Inez, Heather };
244 const int noOfSpanishSpeaking =
sizeof(spanishSpeaking) /
sizeof(
int);
247 const Flight requiredCrew[] =
260 const int noOfFlights =
sizeof(requiredCrew) /
sizeof(Flight);