00001 #ifndef BATH_INCLUDED
00002 #define BATH_INCLUDED
00003
00004 #include "odem.h"
00005 #include <vector>
00006 #include <cassert>
00007
00008
00009 enum BathType {WATER, POLYMER, WATER_POLYMER, WATER_AIR_WATER, AIR, VENTILATOR, OVEN, NONE, UNKNOWN};
00010 enum PlaceType {WATER_PLACE, POLYMER_PLACE, AIR_PLACE, VENTILATOR_PLACE};
00011 enum ReserveType {NOTHING, PARKING, AIR_CHILLING, VENTILATOR_CHILLING, WATER_CHILLING, POLYMER_CHILLING};
00012
00013 extern const char* BathString[];
00014
00015
00016 class PlacePointer : public Msg {
00017 public:
00018 class Place *myPlace;
00019 PlacePointer( char *id, Place *ptr): Msg(id), myPlace(ptr) {};
00020
00021 PlacePointer(const PlacePointer&): Msg(0) {assert(0);}
00022 };
00023
00024
00025 class Place : public Res {
00026 protected:
00027 int myNumber;
00028 PlaceType myType;
00029
00030 public:
00031 PlacePointer* myOwner;
00032 class SetOfRingStack *currentPalette;
00033 class Furnace *currentFurnace;
00034
00035 double entryTime;
00036 double serviceTime;
00037
00038 Place(int no, char *name, PlaceType plType, int capacity, ReserveType rType ):
00039 myOwner(0),
00040 myNumber(no),
00041 myType (plType),
00042 currentPalette(0),
00043 currentFurnace(0),
00044
00045 entryTime(0.0),
00046 serviceTime(0.0),
00047 Res(name, capacity) {};
00048
00049 int number () { return myNumber; };
00050
00051 void setOwner(PlacePointer* ptr) { myOwner= ptr;};
00052
00053 PlaceType getType() const {return myType;};
00054
00055 };
00056
00057
00058 class ParkingPlace : public Place {
00059 public:
00060 ParkingPlace(int no, char *name, PlaceType plType, int capacity):
00061 Place(no, name, plType, capacity, NOTHING) {};
00062 };
00063
00064 class VentilatorPlace : public ParkingPlace {
00065 public:
00066 VentilatorPlace(int no, char *name, PlaceType plType, int capacity):
00067 ParkingPlace(no, name, plType, capacity) {};
00068 };
00069
00070
00071 class BathPlace: public Place {
00072 bool reserved;
00073 public:
00074
00075 BathPlace (int no, char * id, PlaceType plT): reserved(false), Place (no, id, plT, 1, NOTHING) {};
00076
00077 bool isFree() { if (currentPalette) { return false; } else return true; };
00078 SetOfRingStack* palette() { return currentPalette; };
00079 bool isReserved() { return reserved; };
00080 double restTime();
00081
00082 SetOfRingStack* unload();
00083
00084
00085 };
00086
00087 #endif
00088