-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithmA.h
More file actions
44 lines (41 loc) · 1.13 KB
/
AlgorithmA.h
File metadata and controls
44 lines (41 loc) · 1.13 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
#pragma once
/************************************************************************************************
* File: AlgorithmA.h
* Author: Abbey DuBois, Stephen Thomson
* Date: 3/14/2024
* Description: File for Algorithm A where class is defined
*************************************************************************************************/
#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <tuple>
#include <string>
#include "TaskSet.h"
#include "TOR.h"
#include "Schedule.h"
using std::vector;
using std::pair;
using std::tuple;
using std::string;
using std::swap;
using std::get;
using std::make_tuple;
using std::lcm;
using std::to_string;
class AlgorithmA: public Schedule {
private:
int m_gap;
vector<Task> m_set;
vector<TOR> m_torList;
void createTORList();
void sortTaskSetChronologically();
vector<int> sortProcessors(vector<int> chainComputation, int start);
bool canSwap(Task task1, Task task2);
bool inTORList(Task currentTask, Task lastTask, int chainComputation);
public:
AlgorithmA();
AlgorithmA(TaskSet taskSet);
string algorithmASchedule();
void setTaskSet(int index, TaskSet taskset);
};