Ejemplo n.º 1
0
def test_simulateToDeadlineMiss():
    t1 = Task(20,
              50,
              FixedArrivalDistribution(50),
              displayName='t1')
    t2 = Task(2,
              3,
              FixedArrivalDistribution(3),
              displayName='t2')
    taskset = (t1, t2)
    sim = Simulation(taskset)
    state = sim.firstDeadlineMiss()
    expected = SimulatorState(50,
                              [JobState(t2, 16),
                               JobState(t1, 2),
                               JobState(t1, 0, 16, lastStart=48),
                               JobState(t1, 1),
                               JobState(t2, 17)],
                              [StateArrival(100, t1, 2),
                               StateDeadline(51, t2, 16),
                               StateCompletion(52, t1, 0),
                               StateArrival(51, t2, 17),
                               StateDeadline(100, t1, 1)],
                              deadlineMisses=[DeadlineMiss(t1, 0)],
                              scheduler=EDFSchedulerState((50, t1, 0),
                                                          (51, t2, 16),
                                                          (100, t1, 1)))
    assert(state == expected)
Ejemplo n.º 2
0
def burnsWellingsPolicy(taskset):
    rmSorted = rmSortedTasks(taskset)
    lastTask = rmSorted[-1]
    policy = baseRMPolicy(taskset)
    simu = Simulation(taskset, policy)
    dmFilter = DeadlineMissFilter(False, lastTask)
    state = simu.firstDeadlineMiss(dmFilter)
    deadlineMiss = relevantDeadlineMiss(state, lastTask)
    missingExecution(deadlineMiss, state)

    logging.warning('%s', state)
    return policy