-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.py
More file actions
35 lines (25 loc) · 789 Bytes
/
program.py
File metadata and controls
35 lines (25 loc) · 789 Bytes
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
#!/usr/bin/python
import queue
import random
class ProcessingProgram:
def __init__(self, ram, cpu, cpu_type):
self.ram = ram
self.cpu = cpu
self.cpu_type = cpu_type
def print_program_details(self):
print("ram: ", self.ram)
print("cpu: ", self.cpu)
print("cpu_type: ", self.cpu_type)
def get_ram(self):
return self.ram
def get_cpu(self):
return self.cpu
def get_cpu_type(self):
return self.cpu_type
def create_queue(num_of_elements):
q = queue.Queue()
for i in range(0, num_of_elements):
#print("num_of_elements",num_of_elements)
program = ProcessingProgram(random.randint(1, 128), random.randint(1, 50), random.choice([1, 2]))
q.put(program)
return q