| 104 | |
| 105 | |
| 106 | class Job: |
| 107 | def __init__(self, length): |
| 108 | global count |
| 109 | self.id = count |
| 110 | count += 1 |
| 111 | self.length = length |
| 112 | self.started = -1 |
| 113 | self.status = "not started" |
| 114 | self.ended = False |
| 115 | |
| 116 | def __str__(self): |
| 117 | return "{}\tLength: {}\tStarted: {}\tEnded: {}".format( |
| 118 | self.id, self.length, self.started, self.ended |
| 119 | ) |
| 120 | |
| 121 | |
| 122 | def count_status(jobs, status): |