-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtinySWFS2.cpp
More file actions
58 lines (51 loc) · 1.7 KB
/
tinySWFS2.cpp
File metadata and controls
58 lines (51 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include "Fab.h"
#include "margin_alloc.h"
using namespace std;
void print_result(const Fab& fab);
int main()
{
chrono::steady_clock::time_point begin = chrono::steady_clock::now();
//usint machineCounts_exist[12] = { 4,3,10,1,1,2,1,4,1,9,2,2 };
//Fab fab_exist = Fab(machineCounts_exist);
//fab_exist.simulation();
//print_result(fab_exist);
//mass_run_margin_one(fab_exist, 4, 200u, 1u);
//mass_run_margin_two(fab_exist, 4, 200u, 1u);
usint machineCounts_new[12] = { 1,1,1,1,1,1,1,1,1,1,1,1 };
Fab fab_new = Fab(machineCounts_new);
mass_run_margin_one(fab_new, 28, 200u, 1u);
//mass_run_margin_two(fab_new, 28, 200u, 1u);
chrono::steady_clock::time_point end = chrono::steady_clock::now();
cout << "总耗时 = " << chrono::duration_cast<chrono::minutes>(end - begin).count();
cout << "[分钟]" << endl;
}
void print_result(const Fab& fab) {
cout << "target: " << fab.target_lots << " lots;" << endl;
cout << "produced: " << fab.produced_lots << " lots;" << endl;
cout << "t: " << fab.t << " units" << endl;
cout << "mcumsums: ";
for (usint i = 0; i < 11; i++)
{
cout << fab.mcumsums[i] << ",";
}
cout << fab.mcumsums[11] << "; " << endl;
cout << "buffers[60]: ";
for (usint i = 0; i < 60-1; i++)
{
cout << fab.buffers[i] << ",";
}
cout << fab.buffers[59] << "; " << endl;
cout << "machine states: " << endl;
for (usint i = 0; i < fab.mcumsums[11]-1; i++)
{
cout << fab.machines[i] << ",";
}
cout << fab.machines[fab.machines.size()-1] << "; " << endl;
cout << "SEL: ";
for (usint i = 0; i < fab.SEL.size()-1; i++)
{
cout << fab.SEL[i] << ",";
}
cout << fab.SEL[fab.SEL.size()-1] << "; " << endl;
}