Visualization and Simulation in Scheduling
Visualization and Simulation in Scheduling
3/2008
1 Introduction
Scheduling theory plays an important role in optimization
of resources, and is used in many manufacturing and service
industries. In the last fifty years, many optimal and heuristic algorithms have been proposed, but there is growing
demand for transparent and realistic representation of results
in scheduling. The objective of visualization and simulation is
to make these theoretical results accessible to non-experts
in scheduling theory. Especially production scheduling and
planning needs to be represented in a transparent form.
The goal of this work is therefore to extend the existing
TORSCHE Scheduling Toolbox for Matlab [1] by a new tool
for graphic visualization of time schedules.
Scheduling optimizes the utilization of resources with
given constraints in time. In other words, scheduling solves
the problem how to assign given resources to given tasks in
time [2]. Production scheduling is a branch of scheduling
mostly aimed at automated production lines and industrial
production in general [3]. In this paper, visualization means
graphic representation of a schedule in time, whereas simulation monitores the influence of some parameters on a whole
system.
This work emerges from the TORSCHE Scheduling Toolbox for Matlab [http://rtime.felk.cvut.cz/scheduling-toolbox/],
which provides data structures and algorithms for time scheduling. Therefore, the whole project is realized in the Matlab
programming environment [http://www.mathworks.com/].
One of the related tools is TrueTime [4] a Matlab based
tool for real-time simulation for wide spectrum of problems,
e.g. digital filters, embedded systems and wireless networks.
For visualization, OpenGL (Open Graphics Library)
[http://www.opengl.org/] is a standard specification defining a
cross-platform API for writing applications that produce 2D
and 3D computer graphics. This means that visualization can
be realized by OpenGL at any operation system. On the other
hand, Matlab includes the Virtual Reality toolbox, which is
also a sufficient tool for visualization of scheduling results.
From the scheduling area there are also some closely related
works. Optimization using simulation was described by Fishman [5], and the use of simulation based optimization in real
production was briefly described by Manlig and Sramek [6].
Visualization in scheduling has been studied at Karlsruhe
University [7] and an application for visualization of process
scheduling has been developed there.
12
2 Representation of results in
scheduling
Scheduling problems can be divided into three categories:
resources (processors or machines), constraints and criterions. Generally accepted notation of the problem has the form
a|b|g, where a stands for types of processors used, b represents tasks and characteristics of resources, and g denotes
the optimality criterion [2]. For example, 1|rj, ~dj|Cmax represents the problem with one processor (resource), given
release date and deadline for each task, while the objective
is to minimize the latest completion time. The Cmax value
is the most frequently used criterion, because it represents
the throughput of the system [8]. Generally, scheduling is NP-hard problem. Polynomial algorithms are therefore known
only for the limited number of problems. This leads to an
exponential rise in the time needed to find the optimal
solution in dependence on the number of input tasks.
The most common graphic representation of scheduling
results is the Gantt chart [http://www.ganttchart.com/], first
established by Henry Gantt in 1910. The Gantt chart has
discrete time values on the x axis and processors on the y axis
(see Fig. 1). Tasks are represented by a rectangle area on the
intersection of the appropriate processor and the assigned
time. The form of the Gantt chart is identical for all time
Czech Technical University Publishing House
http://ctn.cvut.cz/ap/
3 Implementation
As mentioned above, this project is realized completely in
the Matlab environment, and the output of the application is
a Simulink scheme. Graphical objects for visualization are created in VRedit (part of the Virtual Reality toolbox for Matlab)
and the final visualization is displayed using the Virtual Reality toolbox. The VRedit environment allows us to define basic
geometrical objects, text, background, textures and complex
predefined objects. Each object in Virtual Reality has its own
set of variable parameters. The numerical value of any parameter can be directly changed from Simulink.
The VISIS implementation provides several functions
available for users. For maximum simplicity of usage, the
Simulink scheme is generated automatically. This output
scheme contains one masked subsystem representing the control system. In the case of visualization, there is another block
referencing the predefined virtual reality world. The mask of
the control subsystem has inputs and outputs with user-defined names and sizes. The core of the control subsystem is
the S-function block, which contains the main control function. This function updates the outputs according to the given
schedule and the actual values of the inputs. This control
function is also generated automatically, and all needed external data is created in the Matlab workspace before the
simulation begins. The S-function block has only one input
and output port as default so the in/out signals are integrated/divided to reach user defined number of inputs and
outputs. This subsystem is then masked as one block with
appropriate ports. The Simulink scheme and code for the
S-function block are both generated as text files from the
prepared templates. The control function is called for each
sample of Simulink, and the outputs are updated according to
the schedule and the actual Simulink time.
All implemented functions can be called as standard Matlab functions. Users of VISIS are expected to have basic
knowledge of using the TORSCHE toolbox, and to be able to
create their own project in the Virtual Reality toolbox. The
first step in simulating or visualizing is to create a set of tasks
(function taskset). Then the code of the operations has to be
assigned to the tasks by the adduserparam function. This function reads data from the given text file, and the user-defined
code is assigned to appropriate tasks in the taskset according
to the format of the text file. The next step is to define the
input and output ports for the control block and inputs of the
Virtual Reality block, if needed. Then the set of tasks has to
be scheduled using an appropriate scheduling algorithm
and all created structures are passed to the main function
Czech Technical University Publishing House
http://ctn.cvut.cz/ap/
13
Acknowledgments
This work was supported by the Ministry of Education of the Czech Republic under Research Programme
MSM6840770038.
References
[1] cha, P., Kutil, M., Sojka, M., Hanzlek, Z.: TORSCHE
Scheduling Toolbox for Matlab. In IEEE International
Symposium on Computer-Aided Control Systems Design. Munich, Germany, 2006.
[2] Blazewicz, J. et al.: Scheduling in Computer and Manufacturing Systems. Springer, 1993.
[3] Herrmann, J. W.: Handbook of Production Scheduling.
Springer, 2006.
[4] Ohlin, M., Henriksson, D., Cervin, A.: TRUETIME 1.4
Reference Manual. Department of Automatic Control,
Lund University. 2006.
[5] Fishman, G. S.: Discrete-Event Simulation: Modeling, Programming, and Analysis. Springer, 2001.
[6] Manlig, F., rmek, M.: zen vrobnch zakzek s podporou potaov simulace. In: Prmyslov inenrstv,
2003.
[7] Wittstein, H., Zoller, H., Lieflander, G.: Visualization of
Process Scheduling. Universitt Karlsruhe, Department of
Computer Science. http://i30www.ira.uka.de/teaching/co
urse documents/processscheduling/
[8] Crama, Y., Kats, V., van de Klundert, J., Levner, E.:
Cyclic Scheduling in Robotic Flowshops. In: Annals of
Operations Research, 2004.
[9] Manier, M. A., Bloch, Ch.: A Classification for Hoist
Scheduling Problems. In: International Journal of Flexible
Manufacturing systems, 2003.
[10] Matjek, D.: Optimalizace algoritm pro FPGA. Diploma
thesis, CTU Prague, 2007.
Ing. Roman apek
phone: +420 776 716 588
e-mail: capekr1@fel.cvut.cz
Department of Control Engineering
5 Conclusions
This work has two areas of use: in discrete simulation (e.g.
in digital signal processing) and in visualization of scheduled
problems. VISIS is planed as an extension of a future version
14
http://ctn.cvut.cz/ap/