diff --git a/DSProject/.vs/DSProject/FileContentIndex/02531a88-96d9-4a78-8c00-167000d90d60.vsidx b/DSProject/.vs/DSProject/FileContentIndex/02531a88-96d9-4a78-8c00-167000d90d60.vsidx new file mode 100644 index 0000000..910e79e Binary files /dev/null and b/DSProject/.vs/DSProject/FileContentIndex/02531a88-96d9-4a78-8c00-167000d90d60.vsidx differ diff --git a/DSProject/.vs/DSProject/FileContentIndex/28668473-6dd6-4d23-892e-0e7434d45da3.vsidx b/DSProject/.vs/DSProject/FileContentIndex/28668473-6dd6-4d23-892e-0e7434d45da3.vsidx new file mode 100644 index 0000000..9a00d98 Binary files /dev/null and b/DSProject/.vs/DSProject/FileContentIndex/28668473-6dd6-4d23-892e-0e7434d45da3.vsidx differ diff --git a/DSProject/.vs/DSProject/FileContentIndex/2d0c6141-6722-4c24-b296-33b6dcaa2c57.vsidx b/DSProject/.vs/DSProject/FileContentIndex/2d0c6141-6722-4c24-b296-33b6dcaa2c57.vsidx new file mode 100644 index 0000000..9e12fd7 Binary files /dev/null and b/DSProject/.vs/DSProject/FileContentIndex/2d0c6141-6722-4c24-b296-33b6dcaa2c57.vsidx differ diff --git a/DSProject/.vs/DSProject/FileContentIndex/84934f8c-8ce5-4521-acd3-dabfdda4bdb5.vsidx b/DSProject/.vs/DSProject/FileContentIndex/84934f8c-8ce5-4521-acd3-dabfdda4bdb5.vsidx new file mode 100644 index 0000000..f8215c8 Binary files /dev/null and b/DSProject/.vs/DSProject/FileContentIndex/84934f8c-8ce5-4521-acd3-dabfdda4bdb5.vsidx differ diff --git a/DSProject/.vs/DSProject/FileContentIndex/a7912a78-60ca-45a1-afe6-b430337b2327.vsidx b/DSProject/.vs/DSProject/FileContentIndex/a7912a78-60ca-45a1-afe6-b430337b2327.vsidx new file mode 100644 index 0000000..e9edfec Binary files /dev/null and b/DSProject/.vs/DSProject/FileContentIndex/a7912a78-60ca-45a1-afe6-b430337b2327.vsidx differ diff --git a/DSProject/.vs/DSProject/FileContentIndex/ed7ee1f6-d405-4d4c-a314-d8722225c408.vsidx b/DSProject/.vs/DSProject/FileContentIndex/ed7ee1f6-d405-4d4c-a314-d8722225c408.vsidx new file mode 100644 index 0000000..c8d2b58 Binary files /dev/null and b/DSProject/.vs/DSProject/FileContentIndex/ed7ee1f6-d405-4d4c-a314-d8722225c408.vsidx differ diff --git a/DSProject/.vs/DSProject/v17/.suo b/DSProject/.vs/DSProject/v17/.suo new file mode 100644 index 0000000..416478b Binary files /dev/null and b/DSProject/.vs/DSProject/v17/.suo differ diff --git a/DSProject/.vs/DSProject/v17/Browse.VC.db b/DSProject/.vs/DSProject/v17/Browse.VC.db new file mode 100644 index 0000000..ca8d8f7 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/Browse.VC.db differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/24fd23345564efb1/LINKEDQUEUE.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/24fd23345564efb1/LINKEDQUEUE.ipch new file mode 100644 index 0000000..dfe6c9e Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/24fd23345564efb1/LINKEDQUEUE.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/38d92d06aaa23880/PRI_QUEUE.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/38d92d06aaa23880/PRI_QUEUE.ipch new file mode 100644 index 0000000..ab9643a Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/38d92d06aaa23880/PRI_QUEUE.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/4990301e04fb167e/MAIN.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/4990301e04fb167e/MAIN.ipch new file mode 100644 index 0000000..4363264 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/4990301e04fb167e/MAIN.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/a26fcc356d63ad4c/LINKEDQUEUE.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/a26fcc356d63ad4c/LINKEDQUEUE.ipch new file mode 100644 index 0000000..6b7b2e2 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/a26fcc356d63ad4c/LINKEDQUEUE.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/a43df9c2e8c6e20f/PRI_QUEUE.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/a43df9c2e8c6e20f/PRI_QUEUE.ipch new file mode 100644 index 0000000..98ff1ff Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/a43df9c2e8c6e20f/PRI_QUEUE.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/c02cf28fb6807482/SCHEDULAR.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/c02cf28fb6807482/SCHEDULAR.ipch new file mode 100644 index 0000000..ea48080 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/c02cf28fb6807482/SCHEDULAR.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/c3496b854deac391/PRI_QUEUE.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/c3496b854deac391/PRI_QUEUE.ipch new file mode 100644 index 0000000..b550c4d Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/c3496b854deac391/PRI_QUEUE.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/ccf5731bed71793a/LINKEDQUEUE.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/ccf5731bed71793a/LINKEDQUEUE.ipch new file mode 100644 index 0000000..b86903e Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/ccf5731bed71793a/LINKEDQUEUE.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/cfc00445673ecffb/PROCESS.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/cfc00445673ecffb/PROCESS.ipch new file mode 100644 index 0000000..37e44b2 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/cfc00445673ecffb/PROCESS.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d1ecf2840cc3d96e/CIRCULARLINKEDLIST.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d1ecf2840cc3d96e/CIRCULARLINKEDLIST.ipch new file mode 100644 index 0000000..b88d0b4 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d1ecf2840cc3d96e/CIRCULARLINKEDLIST.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d8011bbf03ccc1a3/CIRCULARLINKEDLIST.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d8011bbf03ccc1a3/CIRCULARLINKEDLIST.ipch new file mode 100644 index 0000000..7f7d304 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d8011bbf03ccc1a3/CIRCULARLINKEDLIST.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d8d2951536fd85e0/CIRCULARLINKEDLIST.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d8d2951536fd85e0/CIRCULARLINKEDLIST.ipch new file mode 100644 index 0000000..b323547 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/d8d2951536fd85e0/CIRCULARLINKEDLIST.ipch differ diff --git a/DSProject/.vs/DSProject/v17/ipch/AutoPCH/ebe8869c6313ba2e/PROCESS.ipch b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/ebe8869c6313ba2e/PROCESS.ipch new file mode 100644 index 0000000..a013375 Binary files /dev/null and b/DSProject/.vs/DSProject/v17/ipch/AutoPCH/ebe8869c6313ba2e/PROCESS.ipch differ diff --git a/DSProject/DSProject/DSProject.vcxproj b/DSProject/DSProject/DSProject.vcxproj new file mode 100644 index 0000000..ec70200 --- /dev/null +++ b/DSProject/DSProject/DSProject.vcxproj @@ -0,0 +1,158 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {b4d825e0-134b-43da-80db-fc7116ed026a} + DSProject + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + +<<<<<<< Updated upstream + + + + + + + +======= + + + + + + + + + +>>>>>>> Stashed changes + + + + + + + + + + \ No newline at end of file diff --git a/DSProject/DSProject/DSProject.vcxproj.filters b/DSProject/DSProject/DSProject.vcxproj.filters new file mode 100644 index 0000000..2af0673 --- /dev/null +++ b/DSProject/DSProject/DSProject.vcxproj.filters @@ -0,0 +1,77 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {bc04a4c2-9cd5-468f-a33f-9f373c034bec} + + + {b4486b4a-fe0f-4e03-9753-73013fccf5c4} + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {8e8e7495-175b-4303-9dc9-e10aa64e5bc8} + + + + + Schedular + + + Data Structures + +<<<<<<< Updated upstream + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files +======= + + Data Structures + + + Data Structures + + + Data Structures + + + Data Structures + + + Process + + + Process + + + Processor +>>>>>>> Stashed changes + + + + + + Schedular + + + Process + + + \ No newline at end of file diff --git a/DSProject/DSProject/Data Structures/CircularLinkedList.h b/DSProject/DSProject/Data Structures/CircularLinkedList.h new file mode 100644 index 0000000..b16fc13 --- /dev/null +++ b/DSProject/DSProject/Data Structures/CircularLinkedList.h @@ -0,0 +1,121 @@ +#pragma once +#include"Node.h" +template +class List +{ + Node* Head; + int GetLen(Node* head) const; +public: + List() { Head = NULL; } + + List(const List& CL) + { + Head = nullptr; + Node* temp = CL.Head; + while (temp) + { + InsertEnd(temp->getItem()); + temp = temp->getNext(); + } + } + + bool Empty()const { return !Head; } + + int Size()const { return GetLen(Head); } + + Node* head()const { return Head; } + + Node*& hhead() { return Head; } + + void InsertBeg(T Val) + { + Node* temp = new Node(Val), * tail = Head; + while (tail && tail->getNext() != Head) + tail = tail->getNext(); + temp->setNext(Head); + if (!Head) + temp->setNext(temp); + else + tail->setNext(temp); + Head = temp; + } + + void InsertEnd(T Val) + { + + Node* temp = new Node(Val); + if (!Head) { + Head = temp; + Head->setNext(Head); + return; + } + Node* tail = Head; + while (tail->getNext() != Head) + tail = tail->getNext(); + tail->setNext(temp); + temp->setNext(Head); + } + bool RemoveBeg() + { + if (!Head) + return false; + Node* tail = Head, * temp2 = Head; + while (tail->getNext() != Head) + tail = tail->getNext(); + if (Head == Head->getNext()) { + delete Head; + Head = nullptr; + } + else { + Head = Head->getNext(); + tail->setNext(Head); + delete temp2; + } + return true; + } + bool Remove(const T& Element) + { + if (!Head) + return false; + if (Element == Head->getItem()) + RemoveBeg(); + else + { + Node* temp = Head, * bye = nullptr; + while (temp->getNext()->getItem() != Element) { + if (temp->getNext() == Head) + return false; + temp = temp->getNext(); + } + bye = temp->getNext(); + temp->setNext(bye->getNext()); + delete bye; + } + return true; + } + void Print()const + { + Node* temp = Head; + if (!temp) + return; + cout << "[ "; + while (temp->getNext() != Head) + { + cout << temp->getItem() << " "; + temp = temp->getNext(); + } + cout << temp->getItem() << " " << "]" << endl; + + } + +}; +template +int List::GetLen(Node* head) const +{ + if (!head) + return 0; + if (head->getNext() == Head) + return 1; + //cout << head->getItem() << endl; + return 1 + GetLen(head->getNext()); +} \ No newline at end of file diff --git a/DSProject/DSProject/Data Structures/LinkedQueue.h b/DSProject/DSProject/Data Structures/LinkedQueue.h new file mode 100644 index 0000000..98b9b5e --- /dev/null +++ b/DSProject/DSProject/Data Structures/LinkedQueue.h @@ -0,0 +1,119 @@ +#pragma once +#include "Node.h" +template +class Queue +{ +private: + + Node* backPtr; + Node* frontPtr; +public: + Queue(); + bool isEmpty() const; + bool enqueue(const T& newEntry); + bool dequeue(T& frntEntry); + bool peek(T& frntEntry) const; + ~Queue(); + + //copy constructor + Queue(const Queue& LQ); +}; +///////////////////////////////////////////////////////////////////////////////////////// + +/* +Function: Queue() +The constructor of the Queue class. + +*/ + +template +Queue::Queue() +{ + backPtr = nullptr; + frontPtr = nullptr; + +} +///////////////////////////////////////////////////////////////////////////////////////// + + +template +bool Queue::isEmpty() const +{ + return (frontPtr == nullptr); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +template +bool Queue::enqueue(const T& newEntry) +{ + Node* newNodePtr = new Node(newEntry); + // Insert the new node + if (isEmpty()) //special case if this is the first node to insert + frontPtr = newNodePtr; // The queue is empty + else + backPtr->setNext(newNodePtr); // The queue was not empty + + backPtr = newNodePtr; // New node is the last node now + return true; +} // end enqueue + + +///////////////////////////////////////////////////////////////////////////////////////////////////////// + + + +template +bool Queue::dequeue(T& frntEntry) +{ + if (isEmpty()) + return false; + + Node* nodeToDeletePtr = frontPtr; + frntEntry = frontPtr->getItem(); + frontPtr = frontPtr->getNext(); + // Queue is not empty; remove front + if (nodeToDeletePtr == backPtr) // Special case: last node in the queue + backPtr = nullptr; + + // Free memory reserved for the dequeued node + delete nodeToDeletePtr; + + return true; + +} +///////////////////////////////////////////////////////////////////////////////////////// + +template +bool Queue::peek(T& frntEntry) const +{ + if (isEmpty()) + return false; + + frntEntry = frontPtr->getItem(); + return true; + +} +/////////////////////////////////////////////////////////////////////////////////// + +template +Queue::~Queue() +{ + T temp; + + //Free (Dequeue) all nodes in the queue + while (dequeue(temp)); +} +///////////////////////////////////////////////////////////////////////////////////////// + + +template +Queue::Queue(const Queue& LQ) +{ + Node* NodePtr = LQ.frontPtr; + frontPtr = backPtr = nullptr; + while (NodePtr) { + enqueue(NodePtr->getItem()); + NodePtr = NodePtr->getNext(); + } +} diff --git a/DSProject/DSProject/Data Structures/Node.h b/DSProject/DSProject/Data Structures/Node.h new file mode 100644 index 0000000..17137de --- /dev/null +++ b/DSProject/DSProject/Data Structures/Node.h @@ -0,0 +1,44 @@ +#pragma once +#include +using namespace std; +//First let's declare a single node in the list +template +class Node +{ +private: + T item; // A data item (can be any complex sturcture) + Node* next; // Pointer to next node +public: + + Node() //default constructor + { + next = nullptr; + } + + Node(T newItem) //non-default constructor + { + item = newItem; + next = nullptr; + + } + + void setItem(T newItem) + { + item = newItem; + } // end setItem + + void setNext(Node* nextNodePtr) + { + next = nextNodePtr; + } // end setNext + + T getItem() const + { + return item; + } // end getItem + + Node* getNext() const + { + return next; + } +}; // end Node \ No newline at end of file diff --git a/DSProject/DSProject/Data Structures/Pri_Node.h b/DSProject/DSProject/Data Structures/Pri_Node.h new file mode 100644 index 0000000..c4ce5d0 --- /dev/null +++ b/DSProject/DSProject/Data Structures/Pri_Node.h @@ -0,0 +1,53 @@ +#pragma once +using namespace std; +template +class Pri_Node +{ +private: + int Priority; + T item; // A data item (can be any complex sturcture) + Pri_Node* next; // Pointer to next node +public: + + Pri_Node() //default constructor + { + next = nullptr; + } + + Pri_Node(T newItem,int Pri) //non-default constructor + { + Priority = Pri; + item = newItem; + next = nullptr; + } + + void setPriority(int Pri) + { + Priority = Pri; + } // end setPriority + + void setItem(T newItem) + { + item = newItem; + } // end setItem + + void setNext(Pri_Node* nextNodePtr) + { + next = nextNodePtr; + } // end setNext + + int getPriority() const + { + return Priority; + } // end getPriority + + T getItem() const + { + return item; + } // end getItem + + Pri_Node* getNext() const + { + return next; + } +}; // end Node \ No newline at end of file diff --git a/DSProject/DSProject/Data Structures/Pri_Queue.h b/DSProject/DSProject/Data Structures/Pri_Queue.h new file mode 100644 index 0000000..2bf483a --- /dev/null +++ b/DSProject/DSProject/Data Structures/Pri_Queue.h @@ -0,0 +1,135 @@ +#pragma once +#include "Pri_Node.h" +template +class PriorityQueue +{ +private: + + Pri_Node* backPtr; + Pri_Node* frontPtr; +public: + PriorityQueue(); + bool isEmpty() const; + bool enqueue(const T& newEntry, int Priority); + bool dequeue(T& frntEntry); + bool peek(T& frntEntry) const; + ~PriorityQueue(); + + //copy constructor + PriorityQueue(const PriorityQueue& LQ); +}; +///////////////////////////////////////////////////////////////////////////////////////// + +/* +Function: Queue() +The constructor of the Queue class. + +*/ + +template +PriorityQueue::PriorityQueue() +{ + backPtr = nullptr; + frontPtr = nullptr; + +} +///////////////////////////////////////////////////////////////////////////////////////// + + +template +bool PriorityQueue::isEmpty() const +{ + return (frontPtr == nullptr); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +template +bool PriorityQueue::enqueue(const T& newEntry, int Priority) +{ + Pri_Node* newNodePtr = new Pri_Node(newEntry, Priority), * temp = frontPtr, * prev = nullptr; + // Insert the new node + if (isEmpty()) //special case if this is the first node to insert + backPtr = frontPtr = newNodePtr; // The queue is empty + else // The queue was not empty + { + while (temp && temp->getPriority() <= Priority) + { + prev = temp; + temp = temp->getNext(); + } + newNodePtr->setNext(temp); + + if (!prev) + frontPtr = newNodePtr; + + else + prev->setNext(newNodePtr); + + if (!temp) + backPtr = newNodePtr; + } + + + return true; +} // end enqueue + + +///////////////////////////////////////////////////////////////////////////////////////////////////////// + + + +template +bool PriorityQueue::dequeue(T& frntEntry) +{ + if (isEmpty()) + return false; + + Pri_Node* nodeToDeletePtr = frontPtr; + frntEntry = frontPtr->getItem(); + frontPtr = frontPtr->getNext(); + // Queue is not empty; remove front + if (nodeToDeletePtr == backPtr) // Special case: last node in the queue + backPtr = nullptr; + + // Free memory reserved for the dequeued node + delete nodeToDeletePtr; + + return true; + +} +///////////////////////////////////////////////////////////////////////////////////////// + +template +bool PriorityQueue::peek(T& frntEntry) const +{ + if (isEmpty()) + return false; + + frntEntry = frontPtr->getItem(); + return true; + +} +/////////////////////////////////////////////////////////////////////////////////// + +template +PriorityQueue::~PriorityQueue() +{ + T temp; + + //Free (Dequeue) all nodes in the queue + while (dequeue(temp)); +} +///////////////////////////////////////////////////////////////////////////////////////// + + +template +PriorityQueue::PriorityQueue(const PriorityQueue& LQ) +{ + Pri_Node* NodePtr = LQ.frontPtr; + frontPtr = backPtr = nullptr; + while (NodePtr) { + enqueue(NodePtr->getItem()); + NodePtr = NodePtr->getNext(); + } +} diff --git a/DSProject/DSProject/Main.cpp b/DSProject/DSProject/Main.cpp new file mode 100644 index 0000000..5ed8254 --- /dev/null +++ b/DSProject/DSProject/Main.cpp @@ -0,0 +1,6 @@ +#include "Schedular.h" +int main() +{ + + return 0; +} \ No newline at end of file diff --git a/DSProject/DSProject/Process/Enums.h b/DSProject/DSProject/Process/Enums.h new file mode 100644 index 0000000..dc189c1 --- /dev/null +++ b/DSProject/DSProject/Process/Enums.h @@ -0,0 +1,9 @@ +#pragma once +enum ProcessState { + NEW, + RDY, + RUN, + BLK, + TRM, + ORPH +}; \ No newline at end of file diff --git a/DSProject/DSProject/Process/Process.cpp b/DSProject/DSProject/Process/Process.cpp new file mode 100644 index 0000000..33ac26c --- /dev/null +++ b/DSProject/DSProject/Process/Process.cpp @@ -0,0 +1,51 @@ +#include "Process.h" + +int Process::counter = 1; + +Process::Process(int ArrivalTime, int CPUTime, int IORequestTime, int IODuration) { + this->ArrivalTime = ArrivalTime; + this->CPUTime = CPUTime; + this->IORequestTime = IORequestTime; + this->IODuration = IODuration; + TerminationTime = TurnAroundDuration = WaitingTime = ResponseTime = 0; + PID = counter++; +} +int Process::GetPID()const { + return PID; +} +int Process::GetArrivalTime()const { + return ArrivalTime; +} +int Process::GetCPUTime()const { + return CPUTime; +} +int Process::GetTerminationTime()const { + return TerminationTime; +} +int Process::GetResponseTime()const { + return ResponseTime; +} +int Process::GetTurnAroundDuration()const { + return TurnAroundDuration; +} +int Process::GetWaitingTime()const { + return WaitingTime; +} +int Process::GetIORequestTime()const { + return IORequestTime; +} +int Process::GetIODuration()const { + return IODuration; +} +void Process::SetTerminationTime(int TerminationTime) { + this->TerminationTime = TerminationTime; +} +void Process::SetResponseTime(int TimeFirst) { + ResponseTime = TimeFirst - ArrivalTime; +} +void Process::SetTurnAroundDuration() { + TurnAroundDuration = TerminationTime - ArrivalTime; +} +void Process::SetWaitingTime() { + WaitingTime = TurnAroundDuration - CPUTime; +} \ No newline at end of file diff --git a/DSProject/DSProject/Process/Process.h b/DSProject/DSProject/Process/Process.h new file mode 100644 index 0000000..8ffb558 --- /dev/null +++ b/DSProject/DSProject/Process/Process.h @@ -0,0 +1,32 @@ +#pragma once +#include "Enums.h" +class Process +{ +private: + static int counter; + int PID; + int ArrivalTime; + int ResponseTime; + int CPUTime; + int TerminationTime; + int TurnAroundDuration; + int WaitingTime; + int IORequestTime; + int IODuration; +public: + Process(int ArrivalTime, int CPUTime , int IORequestTime , int IODuration); + int GetPID()const; + int GetArrivalTime()const; + int GetCPUTime()const; + int GetTerminationTime()const; + int GetResponseTime()const; + int GetTurnAroundDuration()const; + int GetWaitingTime()const; + int GetIORequestTime()const; + int GetIODuration()const; + void SetTerminationTime(int TerminationTime); + void SetResponseTime(int FirstTime); + void SetTurnAroundDuration(); + void SetWaitingTime(); +}; + diff --git a/DSProject/DSProject/Processor/Processor.h b/DSProject/DSProject/Processor/Processor.h new file mode 100644 index 0000000..d2f642a --- /dev/null +++ b/DSProject/DSProject/Processor/Processor.h @@ -0,0 +1,3 @@ +#pragma once +// i am sorry my freind but i wanted the names in my class to be colored :) +class Processor {}; \ No newline at end of file diff --git a/DSProject/DSProject/Schedular.cpp b/DSProject/DSProject/Schedular.cpp new file mode 100644 index 0000000..e69de29 diff --git a/DSProject/DSProject/Schedular.h b/DSProject/DSProject/Schedular.h new file mode 100644 index 0000000..92039d6 --- /dev/null +++ b/DSProject/DSProject/Schedular.h @@ -0,0 +1,14 @@ +#pragma once +#include "Data Structures/CircularLinkedList.h" +#include "Data Structures/LinkedQueue.h" +#include "Data Structures/Pri_Queue.h" +#include "Process/Process.h" +#include "Processor/Processor.h" +class Schedular +{ + Queue NEW, BLK, TRM; // New , BLK , TRM Lists + List MultiProcessor; // Processors List + +public: + +}; \ No newline at end of file diff --git a/DSProject/DSProject/x64/Debug/DSProject.exe.recipe b/DSProject/DSProject/x64/Debug/DSProject.exe.recipe new file mode 100644 index 0000000..33978ee --- /dev/null +++ b/DSProject/DSProject/x64/Debug/DSProject.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\marwan\Desktop\Project_2\DS-project\DSProject\x64\Debug\DSProject.exe + + + + + + \ No newline at end of file diff --git a/DSProject/DSProject/x64/Debug/DSProject.ilk b/DSProject/DSProject/x64/Debug/DSProject.ilk new file mode 100644 index 0000000..57f20ae Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.ilk differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.log b/DSProject/DSProject/x64/Debug/DSProject.log new file mode 100644 index 0000000..3ddd82e --- /dev/null +++ b/DSProject/DSProject/x64/Debug/DSProject.log @@ -0,0 +1,6 @@ + Main.cpp +C:\Users\marwan\Desktop\Project_2\DS-project\DSProject\DSProject\Schedular.h(10,7): error C2065: 'Processor': undeclared identifier +C:\Users\marwan\Desktop\Project_2\DS-project\DSProject\DSProject\Schedular.h(10,17): error C2059: syntax error: '>' +C:\Users\marwan\Desktop\Project_2\DS-project\DSProject\DSProject\Schedular.h(14,1): error C2143: syntax error: missing ';' before '}' + Schedular.cpp + Generating Code... diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.command.1.tlog b/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.command.1.tlog new file mode 100644 index 0000000..c2c8d25 Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.command.1.tlog differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.read.1.tlog b/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.read.1.tlog new file mode 100644 index 0000000..27f5f4e Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.read.1.tlog differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.write.1.tlog b/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.write.1.tlog new file mode 100644 index 0000000..b993058 Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.tlog/CL.write.1.tlog differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/DSProject.lastbuildstate b/DSProject/DSProject/x64/Debug/DSProject.tlog/DSProject.lastbuildstate new file mode 100644 index 0000000..0020951 --- /dev/null +++ b/DSProject/DSProject/x64/Debug/DSProject.tlog/DSProject.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.34.31933:TargetPlatformVersion=10.0.19041.0: +Debug|x64|C:\Users\marwan\Desktop\Project_2\DS-project\DSProject\| diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/link.command.1.tlog b/DSProject/DSProject/x64/Debug/DSProject.tlog/link.command.1.tlog new file mode 100644 index 0000000..d21b545 Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.tlog/link.command.1.tlog differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/link.read.1.tlog b/DSProject/DSProject/x64/Debug/DSProject.tlog/link.read.1.tlog new file mode 100644 index 0000000..ec674c2 Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.tlog/link.read.1.tlog differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/link.write.1.tlog b/DSProject/DSProject/x64/Debug/DSProject.tlog/link.write.1.tlog new file mode 100644 index 0000000..d3e14df Binary files /dev/null and b/DSProject/DSProject/x64/Debug/DSProject.tlog/link.write.1.tlog differ diff --git a/DSProject/DSProject/x64/Debug/DSProject.tlog/unsuccessfulbuild b/DSProject/DSProject/x64/Debug/DSProject.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/DSProject/DSProject/x64/Debug/Main.obj b/DSProject/DSProject/x64/Debug/Main.obj new file mode 100644 index 0000000..4c884fd Binary files /dev/null and b/DSProject/DSProject/x64/Debug/Main.obj differ diff --git a/DSProject/DSProject/x64/Debug/Process.obj b/DSProject/DSProject/x64/Debug/Process.obj new file mode 100644 index 0000000..d9f965c Binary files /dev/null and b/DSProject/DSProject/x64/Debug/Process.obj differ diff --git a/DSProject/DSProject/x64/Debug/Schedular.obj b/DSProject/DSProject/x64/Debug/Schedular.obj new file mode 100644 index 0000000..d0ea3ce Binary files /dev/null and b/DSProject/DSProject/x64/Debug/Schedular.obj differ diff --git a/DSProject/DSProject/x64/Debug/vc143.idb b/DSProject/DSProject/x64/Debug/vc143.idb new file mode 100644 index 0000000..fa80dd4 Binary files /dev/null and b/DSProject/DSProject/x64/Debug/vc143.idb differ diff --git a/DSProject/DSProject/x64/Debug/vc143.pdb b/DSProject/DSProject/x64/Debug/vc143.pdb new file mode 100644 index 0000000..09bdd47 Binary files /dev/null and b/DSProject/DSProject/x64/Debug/vc143.pdb differ diff --git a/DSProject/x64/Debug/DSProject.exe b/DSProject/x64/Debug/DSProject.exe new file mode 100644 index 0000000..560ad7a Binary files /dev/null and b/DSProject/x64/Debug/DSProject.exe differ diff --git a/DSProject/x64/Debug/DSProject.pdb b/DSProject/x64/Debug/DSProject.pdb new file mode 100644 index 0000000..4302aa8 Binary files /dev/null and b/DSProject/x64/Debug/DSProject.pdb differ