10 #ifndef WRENCH_NODEAVAILABILITYTIMELINE_H
11 #define WRENCH_NODEAVAILABILITYTIMELINE_H
14 #include <boost/icl/interval_map.hpp>
15 #include "BatchJobSet.h"
29 class NodeAvailabilityTimeLine {
32 explicit NodeAvailabilityTimeLine(
unsigned long max_num_nodes);
33 void setTimeOrigin(u_int32_t t);
34 void add(u_int32_t start, u_int32_t end, std::shared_ptr<BatchJob>job) { update(
true, start, end, job);}
35 void remove(u_int32_t start, u_int32_t end, std::shared_ptr<BatchJob> job) { update(
false, start, end, job);}
38 std::set<std::shared_ptr<BatchJob>> getJobsInFirstSlot();
39 u_int32_t findEarliestStartTime(uint32_t duration,
unsigned long num_nodes);
42 unsigned long max_num_nodes;
43 boost::icl::interval_map<u_int32_t, BatchJobSet, boost::icl::partial_enricher> availability_timeslots;
45 void update(
bool add, u_int32_t start, u_int32_t end, std::shared_ptr<BatchJob>job);
55 #endif //WRENCH_NODEAVAILABILITYTIMELINE_H