Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update pickup

  • Loading branch information...
commit 46fd6b6284632dd9103bbb703cb8c0dc9b14f857 1 parent 1a15c4b
Mystery authored
View
2  Headers/controller.h
@@ -9,6 +9,8 @@ class Controller
static void Scan();
static void CostFLow();
+
+ static void PickUp();
/* 在这里补充更多算法 */
};
View
38 Headers/qt/emulator.h
@@ -13,44 +13,44 @@
class Emulator : public QWidget
{
Q_OBJECT
-
+
public:
Emulator(QWidget *parent = 0);
-
+
static int dual; /* dual: Time consumed with the whole duration */
-
+
static int nElevator; /* Total number of all elevators */
-
+
static int UNIT_TIME; /* Unit time is set to time consumed by moving elevator up or down a floor */
-
+
static vector<Elevator*> elevators; /* All the elevators functioning */
-
+
static double lambda; /* Poiss process parameter lambda */
-
+
static Floor floors[30]; /* Floors */
-
+
static int nFloor; /* Total number of all floors */
-
+
static string elevatorType;
-
+
static list<Order*> orders;
-
+
private slots:
void startEmulationSlots(); /* Slot bundle with start push button */
-
+
private:
void startEmulator(); /* Start Emulation, if it is already emulated, pause the process */
-
+
bool START; /* Wether game has started, equals false if paused */
-
+
QPushButton *start; /* Start button, placed at right buttom */
-
+
void Born(); /* 产生新的乘客,新的请求 */
-
+
void Control(); /* 调用电梯调度算法 */
-
+
void Move(); /* 电梯依据指令或默认逻辑移动 */
-
+
void Update(); /* 更新统计数据 */
QLabel *nEle; /* Label: 电梯数 */
@@ -61,7 +61,7 @@ private slots:
QLabel *mxDur; /* Label: 最大过程时间 */
QLabel *mnDur; /* Label: 最小过程时间 */
QLabel *avThr; /* Label: 平均电梯吞吐量(每小时) */
-
+
protected: /* Below is QWidget API */
void timerEvent(QTimerEvent*);
void paintEvent(QPaintEvent*);
View
4 Makefile
@@ -7,7 +7,7 @@ ascii: Sources/ascii.cpp Sources/elevator.cpp Sources/emulator.cpp Sources/fcfs.
Sources/floor.cpp Sources/PoissRand.cpp Headers/controller.h Headers/elevator.h \
Headers/emulator.h Headers/floor.h Headers/instruction.h Headers/models.h Headers/internlib.h \
Headers/passenger.h Headers/PoissRand.h Sources/order.cpp Sources/Print.cpp Sources/costflow.cpp \
- Headers/costflow.h
+ Headers/costflow.h Sources/pickup.cpp
$(CC) $(CFLAGS) $(LIBS) -o ascii Sources/ascii.cpp Sources/elevator.cpp Sources/emulator.cpp Sources/fcfs.cpp Sources/passenger.cpp \
- Sources/floor.cpp Sources/PoissRand.cpp Sources/order.cpp Sources/Print.cpp Sources/costflow.cpp
+ Sources/floor.cpp Sources/PoissRand.cpp Sources/pickup.cpp Sources/order.cpp Sources/Print.cpp Sources/costflow.cpp
View
2  Sources/ascii.cpp
@@ -48,6 +48,8 @@ void Control() {
Controller::Fcfs();
} else if (Emulator::elevatorType == "costflow") {
Controller::CostFLow();
+ } else if (Emulator::elevatorType == "pickup") {
+ Controller::PickUp();
}/* else if (Emulator::elevatorType == "costflow") {
* Controller::costflow();
*
Please sign in to comment.
Something went wrong with that request. Please try again.