Operational Research Library  1.0
FlowShopSchedulingProblem.h
Go to the documentation of this file.
1 #ifndef FLOWSHOPSCHEDULINGPROBLEM_H
2 #define FLOWSHOPSCHEDULINGPROBLEM_H
3 
4 #include <iostream>
5 #include <fstream>
6 #include <sstream>
7 #include <algorithm>
8 #include <vector>
9 #include "RandomHelper.h"
10 #include "IData.h"
11 
12 namespace operational_research
13 {
14 
23 {
24 private:
25  // Number of jobs.
26  unsigned int jobs;
27 
28  // Number of machines.
29  unsigned int machines;
30 
31  // Processing times of jobs on machines.
32  std::vector<std::vector<double> > processingTimes;
33 
39  bool checkSchedule(const std::vector<unsigned int>& schedule);
40 
48  void writeResultToFile(const std::vector<unsigned int>& schedule, double costFunctionValue, const std::string& filename);
49 
50 public:
58  FlowShopSchedulingProblem(unsigned int jobs, unsigned int machines, const std::vector<std::vector<double> >& processingTimes);
59 
69  FlowShopSchedulingProblem(unsigned int jobs, unsigned int machines, double minProcessingTime, double maxProcessingTime, bool integerValues = false);
70 
77  FlowShopSchedulingProblem(const std::string& filename);
78 
85  void readDataFromFile(const std::string& filename);
86 
92  void writeDataToFile(const std::string& filename);
93 
97  void showData();
98 
106  void setData(unsigned int jobs, unsigned int machines, const std::vector<std::vector<double> >& processingTimes);
107 
117  void generateData(unsigned int jobs, unsigned int machines, double minProcessingTime, double maxProcessingTime, bool integerValues = false);
118 
125  double evaluatePFSSP(const std::vector<unsigned int>& schedule);
126 
134  double evaluatePFSSP(const std::vector<unsigned int>& schedule, const std::string& filename);
135 
142  double evaluateFSSPB(const std::vector<unsigned int>& schedule);
143 
152  double evaluateFSSPB(const std::vector<unsigned int>& schedule, const std::string& filename);
153 
160  double evaluateFSSPNW(const std::vector<unsigned int>& schedule);
161 
170  double evaluateFSSPNW(const std::vector<unsigned int>& schedule, const std::string& filename);
171 
176  unsigned int getJobs() const {
177  return jobs;
178  }
179 
184  unsigned int getMachines() const {
185  return machines;
186  }
187 
192  const std::vector<std::vector<double> >& getProcessingTimes() const {
193  return processingTimes;
194  }
195 };
196 
197 } // namespace operational_research
198 
199 #endif // FLOWSHOPSCHEDULINGPROBLEM_H
Interface for reading, writing and displaying data.
double evaluateFSSPNW(const std::vector< unsigned int > &schedule)
Evaluates flow shop scheduling problem with no-wait.
Definition: FlowShopSchedulingProblem.cpp:60
void readDataFromFile(const std::string &filename)
Reads flow shop scheduling problem data from a file with a filename.
Definition: FlowShopSchedulingProblem.cpp:198
unsigned int getMachines() const
Getter for number of machines.
Definition: FlowShopSchedulingProblem.h:184
unsigned int getJobs() const
Getter for number of jobs.
Definition: FlowShopSchedulingProblem.h:176
Definition: BinPackingProblem.cpp:3
const std::vector< std::vector< double > > & getProcessingTimes() const
Getter for number of processing times.
Definition: FlowShopSchedulingProblem.h:192
void setData(unsigned int jobs, unsigned int machines, const std::vector< std::vector< double > > &processingTimes)
Setter for flow shop scheduling problem data.
Definition: FlowShopSchedulingProblem.cpp:282
double evaluateFSSPB(const std::vector< unsigned int > &schedule)
Evaluates flow shop scheduling problem with limited intermediate storage (flow shop scheduling proble...
Definition: FlowShopSchedulingProblem.cpp:21
double evaluatePFSSP(const std::vector< unsigned int > &schedule)
Evaluates permutative flow shop scheduling problem with unlimited intermediate storage (permutative f...
Definition: FlowShopSchedulingProblem.cpp:105
void generateData(unsigned int jobs, unsigned int machines, double minProcessingTime, double maxProcessingTime, bool integerValues=false)
Generates flow shop scheduling problem data according to setup.
Definition: FlowShopSchedulingProblem.cpp:145
void writeDataToFile(const std::string &filename)
Writes flow shop scheduling problem data to a file with a filename.
Definition: FlowShopSchedulingProblem.cpp:331
void showData()
Shows flow shop scheduling problem data.
Definition: FlowShopSchedulingProblem.cpp:316
Simple pseudo random number generator class.
Definition: FlowShopSchedulingProblem.h:22
FlowShopSchedulingProblem(unsigned int jobs, unsigned int machines, const std::vector< std::vector< double > > &processingTimes)
Constructor.
Definition: FlowShopSchedulingProblem.cpp:11
Definition: IData.h:14