-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskSet.h
More file actions
69 lines (45 loc) · 1.42 KB
/
TaskSet.h
File metadata and controls
69 lines (45 loc) · 1.42 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
59
60
61
62
63
64
65
66
67
68
69
/************************************************************************
* TaskSet.h
* Author: Stephen Thomson
* Date: 2/8/2024
* Description: This file contains the declaration of the TaskSet class. This class
* is used to store a list of tasks and perform operations on them.
* *********************************************************************/
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "Task.h"
using std::string;
using std::vector;
class TaskSet
{
private:
int m_numTasks;
int m_numProcessors;
bool m_preemptive;
std::vector<Task> m_tasks;
public:
TaskSet();
~TaskSet();
TaskSet(int numTasks, int numProcessors, bool premptive);
TaskSet& operator=(const TaskSet& taskSet);
Task getTask(int index);
vector<Task> getTasks();
void addTask(Task task);
int getNumTasks();
int getNumProcessors();
double calculateUtilizationRate(Task task);
double calculateTotalUtilizationRate();
void setNumProcessors(int numProcessors);
void setNumTasks(int numTasks);
void removeTask(int index);
void printTasks();
void setPreemptive(bool premptive);
bool getPreemptive();
int EUSI();
int USI();
bool checkProcessors();
unsigned long long getLCM();
};