Documentation Status

Welcome to YATSS’s documentation!

YATSS (Yet Another Task Scheduling Simulator) supports the following task scheduling algorithms:

Check out further documentation in RtD

Main Features

  • Easy to adapt to new task scheduling algorithms;
  • Easy to use input/ouput file formats based on YAML;
  • Gantt-like schedule plot using plotly;
  • Support single core only;
  • Documentation.

Installing

conda create --name yatss python=3.6
conda activate yatss
git clone https://github.com/amamory-embedded/sched-learning.git
cd shed-learning
pip install -r requirements.txt

Examples and Usage

Enter the following command to run an example:

>$ python src/run_sched.py examples/wikipedia.yaml
checking the task list ... passed !
The simulation time is: 40
checking the scheduling list ... passed !

These are the supported arguments:

$ python src/run_sched.py -h
usage: run_sched.py [-h] [--ofile OFILE] [-s SIM_TIME] [-v] [--sched [{rms,edf}]] file

positional arguments:
  file                  input file describing the tasks to be scheduled

optional arguments:
  -h, --help            show this help message and exit
  --ofile OFILE         output file with the resulting schedule. If not
                        defined, it will not be saved in a file
  -s SIM_TIME, --simtime SIM_TIME
                        The number of OS ticks to be simulated.
  -v, --verbose
  --sched [{rms,edf}]   list of supported task scheduling algoritms (default: rms)

It is also possible to just visualize an existing scheduling:

>$ python src/show_sched.py examples/wikipedia-sched.yaml
checking the task list ... passed !

It will open in the browser an image like this one.

_images/wikipedia2.png

Graphical Support

YATSS generated gantt-link schedules like this one.

_images/large-sched.png

and it also has hover functionality, displaying the initial/final time and duration of a job.

_images/hover.png

File Formats

YATSS has an input file format to describe the task set to be scheduled and an output file format for the resulting schedule. Both files are based on YAML format.

Input File: Task description YAML file

The following example from wikipedia describes a task set of 3 tasks, as presented in the following table.

Process Execution Time Period
P1 1 8
P2 2 5
P3 2 10

The task set attributes are:

  • Mandatory: algo, tasks;
  • Optional: None

The task attributes are:

  • Mandatory: name, exec_time, deadline, period;
  • Optional: color.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# example from https://en.wikipedia.org/wiki/Rate-monotonic_scheduling
algo: 
  - edf
  - rms
tasks:
  - name: p1
    exec_time: 1
    deadline: 8
    period: 8
  - name: p2
    exec_time: 2
    deadline: 5
    period: 5
  - name: p3
    exec_time: 2
    deadline: 10
    period: 10

Output File: Schedule YAML file

The following example describes a task set of 3 tasks.

The schedule attributes are:

  • Mandatory: algo, sched;
  • Optional: None

The task attributes are:

  • Mandatory: name, jobs. Where jobs is a list of tuples of start and finish job intervals;
  • Optional: color.
 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
36
37
38
title: Wikipedia taskset example with RMS algorithm
sched:
  - color: blue
    jobs:
    - [ 2, 3]
    - [ 7, 8]
    - [16,17]
    - [23,24]
    - [31,32]
    name: p1
  - color: blue
    jobs:
    - [ 0, 2]
    - [ 4, 6]
    - [ 9,11]
    - [14,16]
    - [19,21]
    - [24,26]
    - [29,31]
    - [34,36]
    name: p2
  - color: blue
    jobs:
    - [ 3, 4]
    - [ 6, 7]
    - [11,13]
    - [21,23]
    - [32,34]
    name: p3
  - color: green
    jobs:
    - [ 8, 9]
    - [13,14]
    - [17,19]
    - [26,29]
    - [36,39]
    name: idle
   

Other Simulators

YATSS is just a toy simulator. I made it only for learning more about RTOS scheduling algorithms. If you are looking for something more fancy, take a look ate these other options: