Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add probabilistic WCET feature #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SlimBenAmor
Copy link

The aim of this commit is to add new feature for real time tasks simulator
'simso'. We allow WCET of a task to be defined as a discrete Probability
Distribution Function (PDF) using a matrix (numpy array) of two row: one
for possible WCET values and the other for their corresponding
probabilities. When the WCET of a task is defined as probability
distribution, the simulator will pick random value from the possible WCET
values proportionally to their probabilities. Then, it create a new job
that has as WCET the generated random value.

The modified files in this commit are:

- simso/utils/probabilistic_calc.py: new file contain function that
generate random value according to a probability distribution.
- simso/configuration/Configuration.py: In case of probabilistic
WCET, verify that all WCET values are positive and that
probabilities sum to one.
- simso/core/Job.py: define new attribute '_wcet' individual value
for each job instance.
- simso/core/Task.py: In case of probabilistic WCET, generate random
value of WCET using 'randon_int_from_distr' function from
'probabilistic_calc.py' module. Then, create  new job with
the generated WCET.
- simso/core/__init__.py: change import order to avoid program crush.

misc/script.py file is also slightly modified to add a task 'T1' with probabilistic
WCET. When run, this script will generate a scheduling where several instance
of task 'T1' has different WCET values.

@SlimBenAmor SlimBenAmor reopened this Dec 6, 2018
import numpy as np


def randon_int_from_distr(proba_dist, n_sample=1):
Copy link

@jeanibarz jeanibarz Dec 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the function name : randon instead of random

Copy link

@jeanibarz jeanibarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my (novice) point of view it seems ok except for the typo that requires a little refactoring (cf. my comment) !

@MaximeCheramy
Copy link
Owner

Sorry I didn't have the time to do a proper review yet but I'll eventually do it :).

@SlimBenAmor
Copy link
Author

Thanks for you review. I have fixed the typo. Please feel free to contact me for any additional modification.

@SlimBenAmor SlimBenAmor reopened this Dec 19, 2018
@MaximeCheramy MaximeCheramy force-pushed the master branch 2 times, most recently from d508a37 to a8cb544 Compare February 25, 2022 22:54
The aim of this commit is to add new feature for real time tasks simulator
'simso'. We allow WCET of a task to be defined as a discrete Probability
Distribution Function (PDF) using a matrix (numpy array) of two row: one
for possible WCET values and the other for their corresponding
probabilities. When the WCET of a task is defined as probability
distribution, the simulator will pick random value from the possible WCET
values proportionally to their probabilities. Then, it create a new job
that has as WCET the generated random value.

The modified files in this commit are:

    - simso/utils/probabilistic_calc.py: new file contain function that
    generate random value according to a probability distribution.
    - simso/configuration/Configuration.py: In case of probabilistic
    WCET, verify that all WCET values are positive and that
    probabilities sum to one.
    - simso/core/Job.py: define new attribute '_wcet' individual value
    for each job instance.
    - simso/core/Task.py: In case of probabilistic WCET, generate random
    value of WCET using 'randon_int_from_distr' function from
    'probabilistic_calc.py' module. Then, create  new job with
    the generated WCET.
    - simso/core/__init__.py: change import order to avoid program crush.

misc/script.py file is also slightly modified to add a task 'T1' with
probabilistic WCET. When run, this script will generate a scheduling where
several instance of task 'T1' has different WCET values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants