Symphony 1.0
Loading...
Searching...
No Matches
TaskSchedulerState Class Reference

Represents the state of the task scheduler problem. More...

#include <task_scheduler.h>

Inheritance diagram for TaskSchedulerState:
Collaboration diagram for TaskSchedulerState:

Public Member Functions

 TaskSchedulerState ()
 
 TaskSchedulerState (const TaskSchedulerState &other)
 
 TaskSchedulerState (std::vector< Task > tasks)
 
void print () override
 Prints the state details.
 
- Public Member Functions inherited from State
 State ()
 Constructor for the State class.
 
virtual ~State ()
 Virtual destructor for the State class.
 

Public Attributes

std::vector< Tasktasks
 

Detailed Description

Represents the state of the task scheduler problem.

Definition at line 31 of file task_scheduler.h.

Constructor & Destructor Documentation

◆ TaskSchedulerState() [1/3]

TaskSchedulerState::TaskSchedulerState ( )
inline

Definition at line 33 of file task_scheduler.h.

33 {
34 tasks = {
35 Task("Task 1", 3, 5),
36 Task("Task 2", 2, 3),
37 Task("Task 3", 5, 10)
38 };
39 }
std::vector< Task > tasks
Represents a task with a name, priority, and deadline.

References tasks.

◆ TaskSchedulerState() [2/3]

TaskSchedulerState::TaskSchedulerState ( const TaskSchedulerState other)
inline

Definition at line 40 of file task_scheduler.h.

40 {
41 tasks = other.tasks;
42 }

References tasks.

◆ TaskSchedulerState() [3/3]

TaskSchedulerState::TaskSchedulerState ( std::vector< Task tasks)
inline

Definition at line 43 of file task_scheduler.h.

43: tasks(tasks) {}

Member Function Documentation

◆ print()

void TaskSchedulerState::print ( )
inlineoverridevirtual

Prints the state details.

This method should be overridden by the user to display meaningful information about the state.

Reimplemented from State.

Definition at line 45 of file task_scheduler.h.

45 {
46 for (const auto &task : tasks) {
47 std::cout << "Task: " << task.name << ", Priority: " << task.priority << ", Deadline: " << task.deadline << std::endl;
48 }
49 }

References tasks.

Member Data Documentation

◆ tasks

std::vector<Task> TaskSchedulerState::tasks

The documentation for this class was generated from the following file: