MineLink
 All Data Structures Functions Variables Pages
schedule.h
1 #ifndef __SCHEDULE_H__
2 #define __SCHEDULE_H__
3 
4 #include <vector>
5 #include <fstream>
6 #include <iostream>
7 #include <sstream>
8 #include <stdio.h>
9 #include "../../data_structures/bm/blockmodel.h"
10 
11 
12 using namespace std;
13 namespace delphos{
14 class SchedulingInstance;
23 class Schedule : public BlockModelEntity {
24 private:
25  unsigned int * _periods;
26  unsigned int * _dest;
27  double* _dests;
28  vector<double> *_stocks;
29  SchedulingInstance * _si;
30 public:
31 
38 
39  //Schedule(BlockModel & bm, unsigned int & size);
40  //Schedule(SchedulingInstance * si);
41 
45  Schedule(const Schedule& other);
46 
50  virtual ~Schedule();
51 
57  const unsigned int GetBlockPeriod(const delphos::BlockIndexType& index) const;
58 
64  const unsigned int GetBlockPeriod(const delphos::Coordinates& c) const;
65 
73  const unsigned int GetBlockPeriod(
74  const double & x,
75  const double & y,
76  const double & z) const;
77 
83  const unsigned int GetBlockDestination(const delphos::BlockIndexType& index) const;
84 
90  const unsigned int GetBlockDestination(const delphos::Coordinates& c) const;
91 
99  const unsigned int GetBlockDestination(
100  const double & x,
101  const double & y,
102  const double & z) const;
103 
111  vector<double> GetBlockDestinations(
112  const double & x,
113  const double & y,
114  const double & z) const;
115 
121  vector<double> GetBlockDestinations(const delphos::BlockIndexType& index) const;
122 
123 
129  vector<double> GetBlockDestinations(const delphos::Coordinates& c) const;
130 
131 
132 
139  void SetBlockPeriod(const delphos::BlockIndexType& index, const unsigned int& period);
140 
147  void SetBlockPeriod(const delphos::Coordinates& c, const unsigned int& period);
148 
157  void SetBlockPeriod(
158  const double & x,
159  const double & y,
160  const double & z,
161  const unsigned int & period);
162 
169  void SetBlockDestination(const delphos::BlockIndexType& index, const unsigned int& destination);
170 
177  void SetBlockDestination(const delphos::Coordinates& c, const unsigned int& destination);
178 
187  void SetBlockDestination(const double& x,const double& y,const double& z,const unsigned int& destination);
188 
195  void SetBlockDestinations(const delphos::BlockIndexType& index, const vector<double>& destinations);
196 
203  void SetBlockDestinations(const delphos::Coordinates& c, const vector<double>& destinations);
204 
213  void SetBlockDestinations(const double& x,const double& y,const double& z,const vector<double>& destinations);
214 
226  void StoreAsAttribute(const string& time_attribute, const string& dest_attribute, const bool& multiattr=false);
227 
231  static const unsigned int NO_PERIOD;
232 
239  void SetStockValue (const delphos::BlockIndexType& index, const double& value);
240 
246  double const GetStockValue (const delphos::BlockIndexType& index ) const;
247 
252  const unsigned int StockVarListSize() const;
253 
257  const unsigned int GetStockVarListSize() const;
258 
262  delphos::SchedulingInstance & GetInstance() const;
263 
270  bool ScheduleToTextFile(const char* schedule_file, const bool& multiattr=false) const;
271 
278  bool StocksToTextFile(const char* stocks_file) const;
279 
283  bool Check() const;
284 };
285 }
286 #endif
287 
An utility class to abstract coordinates so they can be used as map and set keys by means of string c...
Definition: coords.h:20
Defines a scheduling instance to be solved.
Definition: instance.h:41
static const unsigned int NO_PERIOD
Definition: schedule.h:231
A base class for object associated to a given block model.
Definition: blockmodel.h:1356
Defines a scheduling of blocks.
Definition: schedule.h:23