You are on page 1of 279

Proceedings in

Informatics and Information Technologies

IIT.SRC 2005
Student Research Conference
Mária Bieliková (Ed.)

IIT.SRC 2005:
Student Research Conference

1st Student Research Conference


in Informatics and Information Technologies
Bratislava, April 27, 2005
Proceedings

Slovak University
of Technology
Bratislava
Proceedings in
Informatics and Information Technologies
IIT.SRC 2005
Student Research Conference

Editor
Mária Bieliková
Faculty of Informatics and Information Technologies
Slovak University of Technology in Bratislava
Ilkovičova 3
842 16 Bratislava, Slovakia

© 2005, The authors mentioned in the Table of Contents


Contributions are printed as delivered by authors
without substantial modifications
Visit IIT.SRC on the Web: http://www.fiit.stuba.sk/iit-src
Executive Editor: Jiří Pospíchal, FIIT STU
Copy Editor: Michal Bielik, Ján Žiak, FIIT STU
Cover Designer: Peter Kaminský

Published by:
Vydavateľstvo STU
Vazovova 5, Bratislava, Slovakia
Preface
Research has been one of the main priorities of the university education since its very
beginning. It is the case also for our university – the Slovak University of Technology
in Bratislava and its youngest faculty – the Faculty of Informatics and Information
Technologies. What is relatively new is a closer connection of research and education.
It is fully in the line of Bologna Declaration and the intention of European Commission
to increase the role of universities in the future society development and building a new
society – the knowledge society.
A closer connection of research and education leads very naturally to a
participation of students in research. Not only the students of post gradual – doctoral
study, where research is a substantial part of their study and one of their principal
activities. A participation of students in research is “going down” to students of
gradual, even pre gradual study.
Universities of technology have a long tradition of students participating in a
skilled labour where they have to apply their theoretical knowledge. The best of these
results were usually presented at various students’ competitions or exhibitions. There
were also combined with student research works. Our university has a long tradition in
such competition named ŠVOČ (abbreviation of the Student Scientific and Technical
Activity). In this academic year our faculty, FIIT STU, decided to transform former
ŠVOČ into the Student Research Conference covering topics of Informatics and
Information Technologies (IIT.SRC). It is completely in the line of Bologna
Declaration and also similar conferences organized by some other universities abroad.
Participants are students of all three levels of the study – bachelor (Bc.), master (Ing.)
or doctoral (PhD.) study.
IIT.SRC 2005 attracted 38 students (10 bachelor, 11 master and 17 doctoral). It
was organized in four sections:
• Artificial Intelligence and Computer Science,
• Security, Computer Systems and Networks,
• Software Engineering,
• Web Technologies and Information Systems.
Besides the 38 papers presented at the conference and included in these Proceedings,
the RoboCup Exhibition was organised as a part of IIT.SRC 2005. RoboCup is an
attractive project with free participation, designed to support education and research in
artificial intelligence, robotics and information technologies. Through several years,
our students achieved interesting results, which were presented during this Conference.
We decided to hold such exhibition as a part of the IIT.SRC and present both the way

v
vi Preface

the RoboCup simulated league is played and also the progress of current students
research in this field.
IIT.SRC 2005 was the result of considerable effort by a number of people. It is
our pleasure to express our thanks to:
• the IIT.SRC 2005 Programme Committee who devoted effort to reviewing
papers and helped with transforming former ŠVOČ to the Student Research
Conference,
• the IIT.SRC 2005 Organising Committee for a smooth preparation of the
Conference,
• the students – authors of the papers, for contributing good papers reporting
their research and their supervisors for bringing the students to the research
community.
Special thanks go to:
• Jiří Pospíchal, Michal Bielik and Ján Žiak, who did an excellent job in the
completion of the proceedings,
• Branislav Steinmüller for providing a submission and review system that
worked perfectly thus allowing reviewing in a very short period, and
• Valéria Šimáková for very effective support of all activities and in making the
Conference happen.
The papers of these Proceedings reflect an orientation of the faculty research, an
implementation of the Bologna Declaration at our faculty, but first of all the results of
student research.

April 2005 Ľudovít Molnár and Mária Bieliková


Conference Organisation
The 1st Student Research Conference in Informatics and Information Technologies
(IIT.SRC), held on April 27, 2005 in Bratislava, was organised by the Slovak
University of Technology (and, in particular, its Faculty of Informatics and
Information Technologies) in Bratislava.

General Chair
Ľudovít Molnár (dean, Faculty of Informatics and Information Technologies,
Slovak University of Technology in Bratislava)

Programme Chair
Mária Bieliková

Programme Committee
Pavel Čičák Vladimír Kvasnička
Norbert Frištacký Jana Minárová
Pavol Horváth Pavol Návrat
Ladislav Hudec Jiří Pospíchal
Milan Kolesár Martin Šperka
Margaréta Kotočová Vladimír Vojtek
Tibor Krajčovič

Organising Committee
Alexandra Bieleková Valéria Šimáková (secretary)
Michal Bielik Jiří Pospíchal
Pavel Čičák (chair) Ján Žiak
Mária Hricová
all from FIIT STU in Bratislava, Slovakia

Sponsoring Institutions
HP Invent
Informatics Development Foundation at FIIT STU

vii
Table of Contents

Artificial Intelligence and Computer Science


Bachelor Degree Program Students
N-Gram Base Statistics Aimed at Language Identification .................................... 1
Tomáš ÖLVECKÝ
A Framework for Simulation of Dynamic Systems................................................ 8
Marek TOMŠA, Richart VESELÝ, Oto VOZÁR
Automatic Grass-Cutter Developed by Genetic Programming............................. 14
Peter SÝKORA
Deterministic Finite State Machine ...................................................................... 21
Vladislav ZÁLEŠÁK
Master Degree Program Students
Adaptation of Formation According to Opponent Analysis ................................. 22
Jaroslav ZAJAC
PhD Degree Program Students
Time Series Prediction Using RSOM and Local Models ..................................... 27
Peter ANGELOVIČ
Analysis of Massive Networks ............................................................................. 35
György FRIVOLT
An Emergence of Game Strategy in Multiagent Systems..................................... 41
Peter LACKO
Optimising Multi-Agent Cooperation Using Evolutionary Algorithm................. 49
Marián LEKAVÝ
Recurrent Neural Network Training with the Extended Kalman Filter................ 57
Peter TREBATICKÝ

Security, Computer Systems and Networks


Bachelor Degree Program Students
Complexity Analysis of Routing Algorithms in Computer Networks.................. 69
Peter BARTALOS

ix
x Table of Contents

Enhancing the Work and Preparation of Instructors Teaching in Cisco


Networking Academy Program (CNAP) .............................................................. 77
Peter MESJAR
Methods for Improving Security of GNU/Linux System ..................................... 83
Tomáš ZAŤKO
Master Degree Program Students
Computer Networks and Remote Control............................................................. 84
Michal KUBÍK
Network Communication Simulator ..................................................................... 90
Tomáš BACKO, Juraj BUNO, Jozef BURÁK,
Daniel KATANA, Marek KOPRLA, Peter PULLMAN
PhD Degree Program Students
Security Mechanisms in Grid Environments ........................................................ 96
Adrian BAGALA, Roland BOTT
Home Agent-Based Decentralized User-Mobility with EPA-Selection ............. 103
Hossam el-ddin MOSTAFA
Advanced Network Approaches for Wireless Environment............................... 108
Branislav JARÁBEK
Internet Single Sign-On Systems ........................................................................ 116
Radovan SEMANČÍK

Software Engineering
Master Degree Program Students
Specialization of Object-Oriented Programs Written in Java Language ............ 127
Igor DYSKO
Object-Oriented Specialization Using Aspect Programming ............................. 133
Adrián SLAVKOVSKÝ
Exploring the Commonality in Feature Modeling Notations.............................. 139
Miloslav ŠÍPKA
Automatic Backup in Oracle Database ............................................................... 145
Miloš SÝKORA
PhD Degree Program Students
Modeling Systems Using Design Patterns.......................................................... 151
Jaroslav JAKUBÍK
On the Composability of Concurrent Systems.................................................... 159
Matej KOŠÍK
Extensional and Intensional Semantics of pUML Objects ................................. 167
Miroslav LÍŠKA
IIT.SRC 2005: Student Research Conference xi

Using UML with OCL as ADL .......................................................................... 175


Matúš NAVARČIK
Design and Prototype Implementation of an Evolutionary Environment
for Concurrent Object-Oriented Programming ................................................... 183
Ján ŽIAK

Web Technologies and Information Systems


Bachelor Degree Program Students
Spot-it – Going Beyond the Vision Loss Boundaries ......................................... 195
Martin ADAM, Michal BARLA Peter SIVÁK, Michal TVAROŽEK
Diablo 2 Tools .................................................................................................... 201
Pavol HLUCHÝ
SecuFORM – webform PHP Framework ........................................................... 207
Ján ŠARMÍR
Master Degree Program Students
A Conceptual Guideline to Design an Information System
for Smart History Project.................................................................................... 213
Marek GREGOR, Ondrej MIKITA
Spatial Planning Support .................................................................................... 219
Marek GREGOR, Ondrej MIKITA
Modules of Content Management Systems and their Reusability ...................... 224
Michal JAKUBÍK
Recommender System for Adaptive Hypermedia Applications ........................ 229
Andrej KRIŠTOFIČ
PhD Degree Program Students
Improving Adaptive Hypermedia by Adding Semantics.................................... 235
Anton ANDREJKO
An Overview of RDF Model Representation Formats ....................................... 242
Vladimír GRLICKÝ
Sharing a User Model between Several Adaptive Hypermedia Applications .... 249
Jaroslav KURUC

ACCOMPANYING EVENTS
RoboCup Exhibition at IIT-SRC 2005 ............................................................... 261
Pavol NÁVRAT, Ivan KAPUSTÍK
Index ................................................................................................................... 263
Artificial Intelligence
and
Computer Science
N-Gram Based Statistics Aimed
at Language Identification
Tomáš ÖLVECKÝ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovak Republic
olvecky@stonline.sk

Abstract. As the web grows, language identification and text


categorization in general is becoming an important issue. Web
environment provides enormous amount of documents, often with
textual and grammatical errors, which makes the task of identification
uneasy. N-gram based approach, which is the basic method for text
categorization, could be used with slight modifications to perform
with more than 95% correct classification rate. Combined with other
methods, like frequent words counting or unique tokens, it is possible
to create efficient and reliable software tools for various purposes. In
this paper, we discuss the ability of n-gram categorization to classify
an unknown text with the highest possible certainty.

1 Introduction
Various subjects from e-mail users to intelligence services around the globe demand
advanced text recognition. However, the mass growth of digital documents on the web
is the main reason why we are concerned with this topic. Search engines try to
categorize crawled pages by various topics, e.g. language, subject, etc., but this
categorization is still unreliable. A superior method must be fault resistant and quick.
On the other hand, it must be able to process a great amount of input in (preferably)
constant time.
The purpose of this work is to present information on automated language
identification methods as well as to show our experiments based on one of these
methods. First we will give a note on why we think it is important to focus on this
field, then we describe the basic ideas used by language detection software and finally


Supervisor: doc. Ing. Mária Bieliková, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 1-7.


2 Tomáš Ölvecký

show how one of those methods (n-gram approach) can be set up to perform better in
recognition tests. Other research, aimed at recognition of various subjects of the same
language is also mentioned.

2 Language recognition methods


There are several approaches to language identification problem. Each of them has
some advantages and we cannot generally say which is better without noticing
disadvantages. The more reliable method is, the more power (CPU time, memory etc.)
it needs.

2.1 Frequent words counting

The simplest method to imagine is to maintain a dictionary for each of available


languages. This approach is called "frequent words counting", because the
identification is based on how many frequent words from each dictionary is found in
the unknown text. The dictionary is however uneasy task to create and maintain.
Another difficulty with frequent words approach is its limited use for flective
languages, which allow morphological changes, word binding, prefixes / suffixes, etc.
Even if we expect the unknown text to be error-free, we would need either an
enormous dictionary, or a word declension algorithm that would handle the rules for
each language.

2.2 Unique tokens

Another common approach is based on the idea that many languages use unique letters
or rare combinations of characters.
Although the score counting could be the same as in previous method, we do not
need to collect large dictionarys to be succesful. Unique tokens are contained not only
in common words, but in the whole vocabulary. Even if we have an input with mixed
content, e.g. with some foregin words, this approach can distinguish between the main
and minor language with a lower error-rate than by using previous method. Unique
tokens perform very fast, but their precision is still beneath our expectations. It can
determine charset of unknown text and limit number of languages for future scanning,
but it is unreliable to use this method separately.

2.3 N-gram based approach

N-grams are substrings generated from larger text [1]. The input is divided into small
parts with maximum length of n, and for every n-gram, the frequency of occurrence is
counted.
N-Gram Based Statistics Aimed at Language Identification 3

After all n-grams are counted, the least frequent are discarded and the rest is
written to a profile. The profile of unknown text is then compared to every category
(language) listed.

Fig. 1. Comparison between unknown text and one of languages

Note that the number of n-grams stored might not be the same for input and
language profiles. Usually it is a good idea to put more n-grams in language profile.

Various approaches use different ways of getting n-grams, like inserting blanks
before each word, skipping some characters, etc. We focus on some of these
parameters to improve precision of this method.

3 Experimental improvement of N-gram method

3.1 Experiments background

For every experiment, little different conditions were used. We used manually sorted
ca. 600 HTML pages from three languages (Czech, Slovak, and Polish) to get a base
for each experiment. Those languages were used, because they are a part of our
problem field and their similarity makes the task of identification uneasy.
Each page was stripped of HTML content and then assigned to one of two levels
for corresponding language. Level 1 was used for pages, which were easy to identify
and rather longer than 2 KB. Level 2 was assigned to pages with non-windows
encoding and for those, which were difficult to identify.

Tab. 1. List of identified pages, (*=size in KB)

directory count total * average *


level 1 level 2 level 1 level 2 level 1 level 2
czech 161 51 886 301 5.50 5.90
polish 128 12 400 38 3.13 3.17
slovak 254 33 1167 141 4.59 4.27
4 Tomáš Ölvecký

Minimal length accepted was 1KB, maximum was 60KB. Later we will show that
it is possible to trim longer input and not increase inaccuracy of the process (see 4.3).

N-gram method has several parameters to be tuned. Those include length of


language profile (see Fig.1), length of input profile, maximal length of tokens (n). We
will reference to those in parentheses to report those parameters. Example (300:80,5)
tells that during the experiment the length of language profile was 300, length of input
profile was 80 and maximal length of n-gram was of 5.

3.2 Training data problem

First, we discuss how quality and quantity of the training data affects the process of
recognition. We might assume that the longer training data is, the more data will be
available and the profile could be closer to the actual language profile. On the other
hand, N-grams are able to distinguish between various topics of the same language and
a long training data from one area can exclude input of the same language but other
areas (see section 5).
In the first experiment, we used two training files, both of Czech language, and
measured how their length affects the identification process. We used following
parameters (300:80,3) and tested on a set of 100 Czech pages (level 1) of size 1-4 KB.

training data: programming training data: news


40 40

35 35
percent occurrence
percent occurrence

30 30

25 25

20 20

15 15

10 10

5 5

0 0
0 10 20 30 40 0 10 20 30 40
training data trimmed to [kb] training data trimmed to [kb]

Fig. 2, 3. Different sizes of training data provide different results

Both charts show increase of identified pages as the training data grows.
However, at certain point, the quality of profile begins to fall off. This might be caused
by small size of pages tested on. We might notice the differences between both charts:
while programming articles involve many technicalities, news articles can be
decomposed to common phrases. Therefore, a longer set of programming articles
N-Gram Based Statistics Aimed at Language Identification 5

results in very small amount of identified pages. On the other hand, even if the profile
czech.news.18 gets almost 35% of all pages, profiles made from longer input provide
still satisfying results.

When thinking of different attributes of training data, we should mention how


longer input affects time needed to create n-gram profile. Figure 3 shows that even if
longer size of training data would provide better results, the computing time would
enormously grow and the identification would be too slow.

exponetial growth of computing time


90

80

70

60
time [s]

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40
training data size [KB]

Fig. 3. Creating profiles from input of different size

Conclusion: Results show that using common language articles of length 18-30
KB provides good results at low computing costs.

3.3 Unknown text trimming

In previous experiment, we showed that the longer training data is, the longer it takes
to compute the n-grams. Because the process of getting n-grams out of unknown text is
virtually the same, we might be concerned with the time it takes to identify texts with
longer size. That is why it is important to focus on how trimming of unknown text
would change the performance of overall process.
In this experiment, we measured how success rate depends on length of text to be
identified. We used both levels for each language and parameters of (300:120,3).
6 Tomáš Ölvecký

Tab. 2, 3. Unknown text trimming


success rate [%]
trimmed to czech polish slovak
level 1 level 2 level 1 level 2 level 1 level 2
1000 95 66 99.2 100 98 100
2000 97.5 70 99.2 100 97.2 100
3000 96.9 66 99.2 100 97.6 100
4000 98.1 66 99.2 100 97.6 100
5000 98.1 72 99.2 100 97.6 100

Conclusion: Although the experiments do not provide clear results, we believe


that it is possible and necessary to shorten long input, especially if n-gram recognition
process is a part of time-critical system.

3.4 Number of n-grams in profile

The last important parameter to mention is the number of n-grams in both language and
input profile. Usually it is better to manage a longer language profile, because we
would match also rare n-grams from input profile without penalty. Another reason for
unequal profile lengths is the computing time. While language profile can be more
time-consuming, it is a one-time process and it is not usually done during time system
responds to the environment.
Circumstances of this experiment: (?:?,3), 100 czech (level 1) pages of size 2-4
KB.

Tab. 4: Various profile lengths and their fitness


input language profile length
profile success rate average score
length 160 300 500 160 300 500
40 91 92 92 0.776 0.776 0.776
80 96 96 96 0.675 0.676 0.676
120 99 99 99 0.611 0.623 0.623
160 99 98 98 0.549 0.598 0.598

Conclusion: Even if the language profile length does not influence the results, we
recommend using rather longer profiles (300-400). On the contrary, the length of input
profile does have a big impact on how many pages are identified correctly. Although
the average score decreases, the recognition power of the method clearly increases.
Therefore, we advise not to use profile length smaller than 100 items.
N-Gram Based Statistics Aimed at Language Identification 7

4 Conclusions
In this paper, we analyzed methods used in language identification with a special aim
at n-gram method. We focused on how n-grams could be tuned to perform better. With
some modifications, it is possible to gain accuracy of this method by almost 10%. This
work showed basic ideas of future research aimed at web categorisation by language
and content.

References
1. Cavnar, W. B. and J. M. Trenkle: N-Gram-Based Text Categorization. In:
Proceedings of Third Annual Symposium on Document Analysis and Information
Retrieval, Las Vegas, NV, UNLV Publications/Reprographics (1994), 161-175.
2. Dunning, T.: Statistical Identification of Language. In: Technical report CRL
MCCS-94--273, Computing Research Lab, New Mexico State University (1994).
A Framework for Simulation
of Dynamic Systems
Marek TOMŠA, Richard VESELÝ, Oto VOZÁR∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovak Republic

Abstract. We present in this paper our implementation of framework


that provides development environment for basic as well as an
advanced modeling of systems from several branches of the artificial
intelligence field of research with the emphasis on population
dynamics, computational genetics, multi-agent systems and fuzzy
logic. Framework implementation is, technologically, based upon
.NET Framework, software development platform created by
Microsoft. The project has two fundamental layers - the framework
itself and a presentation layer dedicated to graphically depict intricate
inner workings of the underlying architecture. Framework itself is,
hierarchically, divided into several namespaces, each grouping classes
into distinct logical units. Framework implementation features clean
object-oriented code and makes heavy use of novel technologies like
runtime code compilation.

1 Introduction
The lack of simple and unified modeling environment that would simplify the process
of development of the evolutionary algorithms and system dynamics caused us to aim
our focus on envisioning and designing such a platform. The purpose of our project
was to make implementation of those, usually quite cumbersome problems easier and
to fill the gap by creating and offering a framework that would meet the
aforementioned criteria.


Supervisor: doc. Ing. Mária Bieliková, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 8-13.


A Framework for Simulation of Dynamic Systems 9

2 Framework overview
Overview of the frameworks fundamental building blocks:
• Core - contains main classes used to simulate dynamic processes. Provides
the class World, which encapsulates the simulation loop, WorldSystem acting
as a junction between simulated system and the interface. Core namespace
also contains many base classes utilizable in the process of dynamic system
modeling.
• Core.Genetics – provides classes for genetics and genetic process modeling.
DNA class provides mechanism for information inheritance as well as
methods for their actual recombination. AllelePair class is an abstraction
forming the basic means of genetic feature bearing.
• Core.FuzzyLogic – contains the implementation of the fuzzy sets, which can
be used for simulation purposes or one might extend them to suit needs of the
specific application based on the framework.
• Core.Compilation – contains classes providing runtime compilation of the
.NET assemblies and dynamic activation of types contained within, used
primarily during runtime for behavior phenotype generation. Potential uses
include runtime entity generation.

3 Genetics
Genetics (from the Greek genno γεννώ - give birth) is the science of genes, heredity,
and the variation of organisms. The word genetics was first applied to describe the
study of inheritance and the science of variation by English scientist William Bateson
in a letter to Adam Sedgewick, dated April 18, 1905.
Virtual simulation of complex genetic processes, which was previously impossible,
quickly became viable as we entered age of computers more than one century later.

3.1 Implementation of genetics

• DNA class – implements operator that provides the ability to recombine two
different DNAs of parents to form the resulting offspring DNA.
• AllelePair class – class encapsulating two Allele instances, forming pair
containing genetic information, also a mechanism to choose prevailing allele
which determines phenotype is provided.
• Allele class – abstract class able to hold any type of information (making it
inheritable)
10 M.Tomša, R.Veselý et al.

• IMutable interface – interface enabling specific feature mutations when


implemented in Alleles. DNA implements IMutable interface so it enables to
mutate all its IMutable Alleles

4 Evolutionary algorithms

An evolutionary algorithm is a generic term used to indicate any population-based


optimization algorithm that uses mechanisms inspired by biological evolution, such as
reproduction, mutation and recombination. Candidate solutions to the optimization
problem play the role of individuals in a population, and the cost function determines
the environment within which the solutions live. Evolution of the population then takes
place after the repeated application of the above operators.

4.1 Possible implementations of evolutionary algorithms

Framework provides two possible types of implementation, each giving different


approach to obtain desired result set.
a) Exogenous algorithm control – each entity has access to global system queues,
which force them to perform actions specified by the system, control flow is
centralized (traditional model), Entities act in this case inherently just as data
structures.
b) Modeling of behavior of the initial population – this approach includes
implementing a mechanism for behavior inheritance utilizing the Behavior
class and implementing behavioral Patterns (discussed later).
In this case, simulation flow is decentralized, with each entity able to act autonomously
Behavior inheritance and recombination supported by the framework makes it
possible to model uncommon evolutionary algorithms and forms good basis for
modeling complex system dynamics.

5 System dynamics
System dynamics is one approach to modeling the dynamics of population, ecological
and economic systems, which usually interact strongly with each other.

5.1 Population dynamics

Population dynamics is the study of marginal and long-term changes in the numbers,
individual weights and age composition of individuals in one or several populations,
and biological and environmental processes influencing those changes.
Population dynamics is also one of the possible applications of the
VirtualWorld framework. Framework enables one to simulate various effects
A Framework for Simulation of Dynamic Systems 11

observable in common population, including but not limited to, inheritance of


quantitative and qualitative features, patterns of behavior affecting offspring by getting
distinct behavioral patterns from both parents, mutations caused by either internal or
external stimuli as well as needs that individual entities necessarily need to satisfy in
order to stay alive while struggling between feral instincts and sexual desire, dictated
by parental heritage in form of their behavioral pattern mixture. While only few could
hope to ever simulate real population precisely, we tried to design complex yet easily
comprehensible code model while maintaining high level of abstraction with support
for future extension.

6 Framework application - RabbitWorld


We have provided RabbitWorld as one particular implementation of simple closed
system. It served the purpose of testing major part of the framework.
Notable simulated entities:
• Rabbit – generalization of simple movable organic entity
• RabbitFood – class serving as a virtual food for each Rabbit instance, which
has to be sought by the individuals in order to sustain their internal life-
supporting states
• RadioactiveCloud – mutational factor
Monitored genetic features include:
• RabbitFur – rabbit fur color, implements IMutable interface
• RabbitBehavior – model of rabbit behavior

6.1 Modeling of behavior

Framework allows to model complex behavior of individual entities that is later, during
the cross-breeding process, inherited along other genetic features. These steps have to
be followed, in order to model behavior:
RabbitBehavior class, representing behavioral phenotype is designed first,
closely followed by the design of an abstract RabbitPattern class, representing
genotype template of the behavior model.

public abstract class RabbitPattern : Pattern


{
[ThinkingBehavior]
public abstract void Think(Rabbit e);
[IdlingBehavior]
public abstract void Idle(Rabbit e);
[PerceptionBehavior]
public abstract Entity Percieve(Rabbit e);
[HuntingBehavior]
12 M.Tomša, R.Veselý et al.

public abstract void Hunt(Rabbit e, Entity victim);


[MatingBehavior]
public abstract void Mate(Rabbit e, Entity partner);
}

Implementation of individual methods representing species-specific behavior


follows. For testing purposes, we have developed two basic behavioral patterns:
LazyRabbitPattern and DilligentRabbitPattern.
AllelePairs containing newly implemented behavior patterns have to be created
next. BehaviorAllele, which aggregates MethodImplementation class instance that
provides atomic behavioral element abstraction, serves this very purpose.

matingBehavior : BehaviorAllele

method : MethodImplementation

[MatingBehavior]
public override void Mate(Rabbit e, Entity partner)
{
Rabbit matingPartner = partner as Rabbit;
e.Copullate(matingPartner);
}

dominance : enum Dominance

{Recessive, Dominant}

Fig. 1. An example of BehaviorAllele instance bearing Mate method


definition from LazyRabbitPatternClass

AllelePair has to be created for each method that represents modeled behavior, which
enables every behavioral element to be inherited independently. Resulting AllelePairs
are inserted into DNA from which the individuals of the initial population are
constructed. During entity instantiation (rabbit, in this case) behavior phenotype
construction occurs. Behavior class is a phenotype abstraction, serving in our case as
a base for the derived RabbitBehavior class.
RabbitBehavior class constructor takes DNA class instance as a parameter, which
is used in the process of AllelePair abstraction, with each containing Alleles
responsible for the behavior itself that are used to generate resulting class source code
from. This class represents the behavior of the new individual. Source code is
dynamically compiled afterwards, using the methods contained within the
EntityFactory class. Resulting RabbitBehavior class instance is then assigned to the
A Framework for Simulation of Dynamic Systems 13

instantiated individual in form of an attribute and its methods are called during the
Refresh method cycle.
This mechanism provides behavior inheritance while retaining clear object-
oriented style. It solves the runtime binding of method calls responsible for the
behavior of the modeled entity.
Individual BehaviorAlleles, as well as other AllelePairs in the DNA are
recombined in the process of cross-breeding and during the instantiation of the new
entity the process of the behavior phenotype initialization is repeated, as described
earlier. Alleles may, naturally, remain in the heterozygous form, which results in
dominant behavior component manifestation and an individual carrying
complementary recessive component.

7 Conclusions
We have modeled simple system which we used to monitor basic population dynamics
principles and verified the framework functionality. We have shown unique framework
features and presented elementary example to demonstrate principle of the behavior
inheritance model functioning.

Related works

G – System - both a framework for simulation as well as a virtual reality itself which
tries to simulate world in which evolution of life takes place. Project is still in its early
phase. http://www.g-system.at

Simile - a software tool for computer simulation of complex dynamic systems in the
earth, environmental and life sciences. Simile uses logic-based declarative modeling
technology to represent the interactions in these systems in a structured way. In Simile,
models are developed diagrammatically, while our framework uses different approach
- C# programming language is used for modeling of objects as well as their behavior.
http://www.simulistics.com/documents/Simile.pdf

References
1. Wikipedia contributors: Evolutionary algorithm. Wikipedia: The Free
Encyclopedia, http://en.wikipedia.org/wiki/Evolutionary_algorithm, 2005.
2. Wikipedia contributors: Genetics. Wikipedia: The Free Encyclopedia,
http://en.wikipedia.org/wiki/Genetics, 2005.
Automatic Grass-Cutter Developed by
Genetic Programming
Peter SÝKORA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
psykora@gmail.com

Abstract. This paper describes how genetic programming can be


applied to a simple problem. The problem is to discover program,
which can control grass-cutter on a toroidal grid with randomly
arranged obstacles, to cut largest area without redundant moves. This
paper shows, how selection of suitable individuals for creation of next
generation of individual solutions (=programs) affects results.

1 Introduction
Genetic programming is one of the methods for developing computer programs. It
reduces time of development and expenses. Specifically, genetic programming
iteratively transforms a population of computer programs into a new generation of
programs by applying analogs of naturally occurring genetic operations. The genetic
operations include crossover (sexual recombination), mutation, reproduction, gene
duplication, and gene deletion.
The goal is, that the next generation of programs should each time obtain better
results at solving given problem than the previous generation and that is why the
selection of suitable individuals for genetic operations is so important. This is provided
by fitness function and selection procedures.

2 Methods
The overall goal is to evolve a successful control program for automatic grass-cutter by
means of genetic programming (GP). The environment of grass-cutter is a toroidal grid


Supervisor: doc. RNDr. Jiří Pospíchal, DrSc., Department of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 14-20.


Automatic Grass-Cutter Developed by Genetic Programming 15

with randomly placed obstacles. This environment was used to simulate each cutter's
control program to obtain fitness measurement.

2.1 Environment

Cutter starts in the left corner of 32x32 square toroidal grid surface. That means, that
every square has the same number of neighbors (four). Each square can be in one of
three states: empty (already visited), grass or obstacle. Grass-cutter can only move to
square with grass, or grass cut.

2.2 Cutter Control Programs

Cutter executes n-times it's control program or it is executing this program until all
grass is cut. Each move increments numMoves variable. Rotating cutter left, or right
costs nothing. Cutter sees one field ahead in it's direction and can take action, if there is
grass or obstacle.
Programs are represented as trees, with internal nodes from the function set and
the leaves chosen from the terminal set. Functions may execute one or more sub-
branches depending on the specific function and state of the simulation.
Table 1 presents the tableau for the Automatic Cutter Problem, and lists the
function and terminal sets. Table 2 explains the terminals, and Table 3 describes the set
of functions.

Table 1: Tableau for the Automatic Cutter Problem


Objective: To cut largest area with smallest number of moves
Terminal Set: TURNL, TURNR, MOVE
Function Set: IFGRASS, IFOBSTACLE, PROGN2, PROGN3
Fitness Test: Simulation of cutter program on given environment.
Raw Fitness: Uncollected grass + c * number of redundant steps
Parameters: Variable
Result designation: The individual with highest fitness from all generations

Table 2: Terminals
TURNL: Turns the cutter left (changes the direction)
TRUNR: Turns the cutter right
MOVE: Move the cutter one square ahead in its direction, if there is no obstacle on
that field. If there is grass, it is automatically collected
16 Peter Sýkora

Table 3: Functions
IFGRASS: Has 2 parameters. Evaluates first parameter, if there is grass one
field ahead or second parameter, if there's no grass
IFOBSTACLE: Has 2 parameters. Evaluates first parameter, if there is obstacle one
field ahead or second parameter, if there's no obstacle
PROGN2: Has 2 parameters. Evaluates all 2 arguments in sequence
PROGN3: Has 3 parameters. Evaluates all 3 arguments in sequence

2.3 Fitness evaluation

There are two areas of focus in calculating the fitness function. One is the number of
uncollected grass(UG) and other is the number redundant moves(RM). Raw fitness
value is calculated as UG + c*RM. The selection of suitable constant c is important. It
follows from this fitness function , that 1/c redundant moves decrease the fitness value,
as one uncut field. For example, when c=0.2 (1/c = 5), cutting one more grass field is
5-times more important as reducing the number of redundant moves.
Raw Fitness = UG + c*RM
Standardized Fitness = same as Raw Fitness, because low raw fitness value is
desired
1 1
AdjustedFitness = =
1 + StandarizedFitness 1 + UG + c × RM
Values of UG and RM are obtained by running controlling program n times on the
given map, or until all grass fields are cut. Test runs shows, that 4096 as n value is
sufficient.

2.4 Suitable Individuals Selection Methods

Roulette Selection Method and Tournament Selection Method are used for selecting
suitable individuals for creating next generation

Roulette Selection Method


One of the simplest selection methods is roulette wheel selection. It is stochastic
algorithm and works this way:
Individuals are mapped on continuous intervals of numeric axis, so that interval
length of every individual equals to it's fitness. First interval starts in 0 and every next
interval continues where previous interval ends. Then there is generated a random
number from 0 to last interval end, and that individual is selected, in whose interval
this random number is. This process is repeated until required number of individuals is
selected.
Automatic Grass-Cutter Developed by Genetic Programming 17

Tournament Selection Method


In tournament selection method, the given number of individuals is selected randomly
from population and the best from this group is selected as a parent. This process is
repeated, until the required number of individuals is selected. The number of selected
individuals for tournament is named Tour and is between 2 and the number of
individuals in population.

2.5 Genetic Operations

Reproduction
Asexual method. Reproduction is, when individual is copied into the new population. It
has same effect as if individual survived to the next generation. Copied individuals do
not need to be evaluated again, because their fitness was measured in previous
population.

Crossover
Crossover needs two individuals and produces two individuals into the new population.
There are selected random nodes, of each of both individuals and subtrees starting with
these nodes are exchanged. The tree depth of created individuals must not exceed
maximum tree depth.

Mutation
Mutation is asexual operation. Individual is selected, with a selection method. Then
random node is selected and some type mutation is applied. In Swap Mutation the node
is replaced with the same argument number node. In Standard Koza's Mutation the
subtree of selecting node is removed and is replaced with newly generated tree.

2.6 Software/Hardware used

Program for test runs described in this paper was written in C++ using STL (standard
template library). The runs were executed on a PC with a Pentium 4 – 2 GHz
processor. One run takes about ten minutes.

3 Results

3.1 Parameters Selection

In the first experience with this problem, I have tried small populations, shallow trees
and many generations. Each run other parameter values were tried. Increasing number
18 Peter Sýkora

of participants in tournament(Tour) led to early convergence using tournament


selection. I have started with maximum program depth 7, but this shows to be
unsuitable on maps with many obstacles. Thousands of generations seemed to be waste
of time, because nearly always the best individual was found within the first 2 hundred
generations.
Best results were obtained with the following values:
• Constant c in fitness function: 0.01
• Population size: 1000
• Number of generations: 300
• Number of participants in tournament (only in tournament selection): 2
• Maximum tree depth: 21
• Minimum tree initialization depth: 2
• Maximum tree initialization depth: 5
• Grow-type initialization probability: 0.5
• Crossover probability: 0.9
• Crossover distribution probability (non-terminal node sel. proba.): 0.9
• Standard (Koza's) mutation probability: 0.08
• Standard mutation max. regeneration depth: 5
• Swap point mutation probability: 0.02
• Swap point mutation distribution probability: 0.5
Automatic Grass-Cutter Developed by Genetic Programming 19

3.2 Sample

Figure 1: Sample Starting Map

Figure 2: Average fitness of population in each generation, using different selection


methods

The test problem and results for the two tested selection methods are shown
in Figs. 1 and 2. Best individual on this map was found in 101st generation using
20 Peter Sýkora

tournament selection. This individual collects 1014 of 1014 fields of grass with only
1022 moves.

4 Conclusions
This paper demonstrated that genetic programming is useful for complicated graph
searching problems, to which large maps belong. Two selection methods were tested,
but our result did not show, that one of these methods is significantly preferable. In the
test problem, published in this paper, very good results were obtained by both of these
methods. While the tournament selection provided slightly better results, further
statistical analysis will be needed to prove its superiority.

Acknowledgement: This work was supported by Scientific Grant Agency of Slovak


Republic under grants #1/1047/04 and #1/0062/03, and by Science and Technology
Assistance Agency under grant APVT-20-002504.

References
1. Koza, J.R.: Genetic Programming: On the Programming of Computers by Means
of Natural Selection. Cambridge, MA: The MIT Press, 1992.
2. Zhang B., Kim J.: Comparison of Selection Methods for Evolutionary
Optimization. Evolutionary Optimization, Vol. 2, No. 1 (2000), 55-70.
Deterministic Finite State Machine
Vladislav ZÁLEŠÁK*
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
aic@ynet.sk

Abstract. This work deals with deterministic finite state machine


(DFSM). Deterministic finite state machine is a set (Q,W,d,q[0],F),
where Q is a finite set of all states of the machine, W is the finite set
of all possible input values, d (Q x W) is the transition function
defining for each combination of state q and input value w, what the
next state of the machine will be. F is the set of terminal states. The
function of a DFSM is defined as a passing from q[0] to q[n] for a
word composed of n-letters, where for each state the machine either
finds the corresponding transition to the next state if it exists. If there
are no more input values, the machine is either in a terminal state and
that means the input word passed through the machine successfully, or
it is not in a terminal state and the input word did not get through the
machine successfully.
The result of this work is a program named Staam. It allows the
user to define a DFSM, save it and load it, test a word using a DFSM
and some more options. Implementation of DFSM is through a graph
with one directional edges. In this graph there can be an edge between
each two vertexes, even if the starting vertex is the same as the
destination vertex and the maximum number of edges is limited only
by the amount of input values the DFSM handles. The program Staam
not only simulates a DFSM, but the user can read through a log to see
in detail how the machine was working. It has the option to process
the input word step by step as well.

*
Supervisor: Ing. Anna Považanová, Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, p. 21.


Adaptation of Formation According
to Opponent Analysis
Jaroslav ZAJAC∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia ka
zajacjaro@orangemail.sk

Abstract. The positional game is an important factor on the path of


achieving good results in football. The ability to predict the behavior
of the opponent can have a major role in making the correct decisions
in a partially observable environment, like robotic football. This work
proposes a new method of using the coach and formations, which has
not been used in the world so far. The method analyzes the movement
of opponents and recommends formation changes to our team. The
coach recommends optimal positioning of his players on the playfield
based on the statistical analysis of opponent players’ position.

1 Introduction
Simulated soccer is a client-server multi-agent distributed system, in which the agents
have limited methods of communication. The server handles the simulation of a virtual
soccer field. 24 clients (2 teams), consisting of 10 players, a goalie and an online coach
each, connect to the server to play a simulated soccer game. Each type of client has its
own limitations. The limitations of players include a sight channel limitation.
The player has a field of view (FOV), which never covers the whole playfield
(thus partially observable environment). The server sends to the player only visual
information about object in his FOV at a frequency depending on the quality and width
of the FOV. Thus the player has usually too little information about his surroundings,
which makes it difficult for him to determine a position for him, where he would be
most beneficial to the team. Also, the sight channel is affected by noise generated by
the server, which distorts the positional information about object in the players’ FOV.


Supervisor: Ing. Marián Lekavý, Institute of Informatics and Software Engineering, Faculty
of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 22-26.


Adaptation of Formation According to Opponent Analysis 23

Various attempts have been made to reduce this limitation using the
communication channel to send information about the surrounding objects and players
to team members. However the communication channel is limited by a message length
of 10 characters. Also the number of messages a player can receive per play cycle,
which are 1 message from his teammates and 1 message from the opponent team, is
limited.
The purpose of the method proposed in this paper is to reduce the effects of the
players’ sight and communication channel limitations by using one of the main online
coach advantages: his sight channel covers the entire playfield, and it is not affected by
noise.

2 The method
The coach receives visual information about the entire playfield each play cycle. The
positional information about the enemy team is collected. After a period of time the
gathered information is being evaluated and an optimal formation is composed and sent
to the team. The formation is assembled from sub-formations. For each part of the sub-
formation a different criteria of determining the most appropriate sub-formation is
used.

3 The modules
There are two modules, which cooperate on the task of determining the optimal
formation. The analyzer module named CoachAnalyzer and the Formation module.

3.1 CoachAnalyzer

The CoachAnalyzer has its own interpretation of the playfield. It divides the playfield
into sectors of 2x2 meters (the playfield dimensions are 105x68 meters, the remaining
1 meter is added to the last column of sectors), making a sector map of 52x34 sectors.
This map of the playfield contains for each sector the number of cycles the coach has
observed an enemy player in the given sector.
Each play cycle the coach passes visual information gathered in the cycle to the
CoachAnalyzer. The CoachAnalyzer analyses this information and increments the
values of each sector containing an enemy player by 1 per enemy. The result after a
period of time is a map containing relative amounts of time the enemy spent in each
sector. After a period of time the CoachAnalyzer uses the data in the map to compute
an optimal sub-formation for the defense and offence part of the sub-formation.
The goal of the algorithm for finding the optimal attack formation is to find
corridors from the centerline to the enemy goal line, which are least occupied by the
enemy. For each possible sub-formation consisting of 3 to 6 players the algorithm sums
the sector values of corridors with a width of 5 sectors (10 meters). The goal is to find
the sub-formation with a minimal value of the sum (minimal resistance). After finding
such sub-formation, this is then proposed to the coach.
24 Jaroslav Zajac

The algorithm of finding the best defense sub-formation uses a different


approach. Each sub-formation comes with a field coverage, which is computed
externally (by the application UnitCreator, developed by Jaroslav Belluš, more
information can be found at [6]) from the positions of players in the given sub-
formation. The sector the player stands on has coverage of 1.0, the sector, which is 10
sectors away from the home sector (the one the player stands on according to the sub-
formation), has coverage of 0.0. The sectors in-between have a linearly decreasing
coverage.
The algorithm looks for a maximum value of the sum (1), where, f(x, y) is the
value of the sector x, y from the map created by the CoachAnalyzer, c(x, y) is the
coverage of the sector x, y for the given sub-formation and offset is a value between 0
and 25 representing the offset in sectors of the defensive sub-formation from the home
goal line (1 sector = 2 meters, thus the defensive sub-formation can cover any part of
the defensive half of the playfield).
10 34
fitness = ∑∑ f (i + offset , j ) * c(i, j ) (1)
i =0 j =0
The sum is computed for each sub-formation and for each sub-formation offset.
The result of the sum is then averaged to represent the average coverage per player in a
sub-formation, so the algorithm doesn’t overvalue large numbers of defensemen. The
best sub-formation and its offset are then recommended to the coach, who includes it in
the formation.
The midfield part of the formation then consists of the rest of the players not
assigned to either offence or defense, aligned in a line. This method uses the midfield
part of the formation as a player stack, from which the offence and defense part take
players into the respective sub-formations.

3.2 Formations

The formation module is a result of cooperation with Jaroslav Belluš. It is based on the
work of Ján Pidych [5], to which modifications have been made to better suit the
dynamic formation generation and changes. In the previous version there have been
some factors limiting the composition of formations from available sub-formations.
Also the set of available sub-formations was inadequately implemented.
The offset mentioned in the previous section has been added to the module. The
hard coded formations have been removed and a sub-formation loading routine
implemented to easily change the sub-formations available for composition via a
configuration file generated by the UnitCreator. The mechanism of assigning roles to
players in a formation, defining the style of play, needed to be rewritten to better suit
the new features the formation module. The coverage of players in each sub-formation
has been implemented. These changes were necessary for the CoachAnalyzer module
to find an optimal formation composed of a defensive, center and offensive sub-
formation.
Adaptation of Formation According to Opponent Analysis 25

4 Conclusions
The method has been implemented on top of the team Stjupit Dox 2004 [3]. The
method has been tested in a number of matches against the teams Stjupit Dox 2004,
Leaky Cleats [1, 4] (Deravá Kopačka in Slovak), Glass [2] (Sklo in Slovak). The
impact on the scoring is controversial. The results were varying from a 2:0 victory to a
1:3 loss. By closely examining the development of the matches a better understanding
of the effects of this method can be seen. The reasons of a lack of a definite
improvement in the scoring of the team can be found in the lower layers of the player,
on top of which this method has been implemented. The main reasons are the inability
of defensemen to get in possession of the ball even from a closely covered enemy
player and the overall kick inaccuracy of the team, for which the reasons have not been
found and are not the subject of this paper.
The best observable results produced by this method are excellent coverage of
enemy attackers by the defensive sub-formation, basically producing an
implementation of personal defense, in which usually each defenseman is always near
an enemy attacker. In the offensive part of the formation the method successfully
chooses sub-formations exploiting weaknesses in the enemy defense. The best results
are in situations, where the enemy team has the defense formed in front of the goal,
while the wings are uncovered. The method correctly chooses a wide sub-formation, in
which the wings are uncovered most of the time.
A disadvantage of the current implementation of the algorithm recommending the
optimal offense sub-formation doesn’t take into account the distribution of players
along the x axis of the playfield, thus all sub-formations with identical player counts
and y coordinates of its players yield the same fitness, resulting in choosing the first
found sub-formation, which usually is a line formation composed of n players. By
refining this method, for example by dividing the formations into aggressive,
defensive, neutral a more appropriate selection of sub-formations can be achieved.
However the question has to be answered, which sub-formations can be categorized as
aggressive. Those with the middle players in front of wingmen or the other way
around? The same question has to be answered for neutral and defensive types.
The devised method was fully implemented and tests showed that it improved the
quality of players’ displacement policy. Because of the lower player logic, we were not
able to achieve substantial score improvement, however the new formation algorithm
was able to improve the game style and adapt to the opponent formation.

Acknowledgement: This work was supported by Science and Technology Assistance


Agency under the contract No. APVT-20-007104.

References
1. Dirga, P. et al.: Deravá Kopačka – Softvér. Bratislava, FEI STU, 2003, Team
project.
2. Gorbatchev, S., et al.: RoboCup – Simulácia robotického futbalu. 2004, Team
project.
26 Jaroslav Zajac

3. Horváth, M., et al.: Robocup – Vyššie schopnosti hráča. Bratislava, FEI STU,
2003, Team project.
4. Lekavý, M., et al.: Multiagent coordination in the domain of robotic soccer. In:
ZNALOSTI 2005, Poster proceedings, 2005, pp. 65-68.
5. Pidych, J.: Diplomový projekt. Bratislava, FEI STU, 2002.
6. Zajac, J., et al.: Simulácia robotického futbalu. Bratislava, FIIT STU, 2005, Team
project.
Time Series Prediction Using RSOM
and Local Models
Peter ANGELOVIČ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
angelovic@fiit.stuba.sk

Abstract. The article gives a short survey in the area of time series
prediction, its definition and certain solutions. The main emphasis of
this article is put on prediction with the use of local models and
artificial neural networks. Detailed analysis of SOM and RSOM
neural networks and its usage in temporal quantization is given. The
article is also concerned about verification of prediction skills of the
system with RSOM and MLP neural networks in real time series.

1 Introduction
The main motivation for analysis and research of time series is the desire to predict the
future and understand fundamental features and processes in systems, which are used
in every sector of human life. Time series prediction concentrates on building models,
which describes process using available knowledge and information. These models can
be used to simulate the future events in the process.
Time series is formed from measurements or observations natural, technical or
economical processes, which are made sequential in time. In general, consecutive
samples of time series have an important feature that value or sample depends on
sequence of consecutive samples, which have been located just before. Because of this
dependency, it is possible to perform estimation or prediction of future values in time
series. This fact can be expressed by equation:

x (t + 1) = f ( x (t ), x (t − 1),..., x (t − N + 1) ) (1)


Supervisor: prof. Ing. Vladimír Vojtek, PhD., Institute of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 27-34.


28 Peter Angelovič

where x(t) is sample or state of the system in time step t, f is dependency between
sample in time step t+1 and previous samples, N is number of the previous samples,
which are relevant for computing the new state of the system. There is no reason for
big number of previous samples in the real applications. Usually certain interval of
consecutive samples is used. This interval is called time window and computation of
the sample x(t+1) is called prediction.
In science, technology and economy there exists many processes and phenomena,
whose prediction is important due to their usefulness and financial profit. These
include different industrial processes that can be modeled, predicted and controlled
based on some sensory data. Many phenomena of nature, such as daily rainfall or
probability of an earthquake would also be useful to predict. Medical applications
include for example modeling biological signals such as EEG or ECG to understand
better the patients state. In economy stock market prices are an example of a possibly
very profitable prediction tasks.

2 Prediction models
Nowadays, there are various approaches used in time series prediction. The oldest and
frequently used methods are statistical regression linear models [3], because the theory
of these models is well known, and many algorithms for model building are available.
They include linear autoregressive models (AR), moving average models (MA), mixed
models (ARMA) and mixed integrated models (ARIMA).
In practice almost all measured processes are nonlinear to some extent and hence
linear modeling methods turn out to be in some cases inadequate. On the other side,
nonlinear methods are time-consuming, that’s why they were unusable in real time
applications a few years ago. With the growth of computer processing and data storage,
the usage of various nonlinear methods has expanded. Artificial neural networks
became very popular in this sector [4]. They are motivated from biological knowledge
about structure and functionality of human brain. Neural networks consist of huge
amount of simple computational units – neurons, which are connected in some manner.
The way of connection and computation that they perform depends on the type of the
task. Learning or adaptation is the typical feature of neural networks. Optimization of
all the model parameters is carried out at the same time with the learning algorithm.
Many types of neural networks for prediction have been formed. First neural
network used in prediction tasks was multilayer perceptron (MLP), which became very
popular during 1980s. Temporal and contextual information in internal structure of
network is implemented in Time Delay Neural Network. Input of this network is
created from the samples of the time window, which is presented into the network at
the same time. This is first implementation of memory in neural network. Another
network, which is often used in prediction tasks and includes memory in the internal
structure, is FIR MLP (Finite Impulse Response MLP). Memory is implemented in the
structure of connections between neurons. Recurrent neural networks such as Jordan or
Elman networks are also used for temporal processing. The newest networks used in
time series prediction are Echo State Networks, which gives promising results.
Time Series Prediction Using RSOM and Local Models 29

2.1 Local prediction models

All prediction models can be divided into global and local prediction models. Models
mentioned above were the global models. In this approach only one model is used to
characterize measured process. Global models give best results with stationary time
series. But, when the series is nonstationary, identifying proper global model becomes
more difficult. Local models often overcome some of the problems of the global
models such as computing complexity and accuracy in prediction (see Fig. 1). They are
based on dividing the data set to smaller sets of data, each being modeled with simple
local model.

Fig. 1. On the left picture approximation of time series with one global model
GM is shown. The same time series is modeled with three local
models LM1, LM2 and LM3 on the right.

The base method, which uses local models for prediction, is called k nearest
neighbors [6]. Local models require a data set with many examples of both the
observed variables and the process output. The model can be constructed then and used
to estimate the process output for a new input, which is not part of data set. Local
model output is calculated using three consecutive stages. The first stage finds first
k closest vectors, or nearest neighbors of observed variables in the data set. The second
stage constructs a simple model using only k chosen samples. The third stage evaluates
the model to estimate the process output.
Next method known from machine learning is algorithm M5‘, which builds
models tree during the learning phase [7]. Each internal node of the tree denotes a test
on an attribute or value of input vector, each branch represents an outcome of the test,
and leaf nodes represent linear regression models. Branching in internal nodes leads to
dividing input space of attributes into disjunctive regions. Dependency between inputs
and target values in these regions can be expressed by linear model.
Division of the input space of attributes can be performed by many clustering
methods or self organizing maps (SOM). SOM is able to divide input set of samples
into subsets with similar properties. But losing of contextual information during
division process is a big disadvantage, because it is important property in process of
30 Peter Angelovič

time series prediction. For example, if there are two samples with the same value both,
but different context, the SOM assigns them into same cluster, and then local model
predicts the same results. This problem can be overcome by injecting the memory
structure into the clustering process and making what we call temporal quantization. In
[2] is detailed survey of SOM models with memory mechanism. Next section is
concerned about time series prediction using SOM with contextual mechanism.

3 Modeling temporal context with SOM


Temporal context in the series can be stored in the model by using some kind of
memory structure. In [5] is presented an extension to the SOM the Recurrent Self-
Organizing Map (RSOM) that allows storing certain information from the past input
vectors. The information is stored in the form of difference vectors in the map units.
The mapping that is formed during training has the topology preservation characteristic
of the SOM as explained in next section.
RSOM can be used to determine the time context of each vector in the series of
consecutive input vectors by performing temporal quantization mentioned earlier. It is
now possible to use context with the current input of the model to select a different
local model in cases where the current input vector looks the same, but the context is
different. In prediction the closest reference vector of the RSOM, called the best
matching unit or the winner, is searched for each input vector. A local model that is
associated with the best matching unit is then selected to be used in prediction task in
that time.

3.1 Self-organizing map

SOM is a vector quantization method with topology preservation, when the dimension
of the map matches the true dimension of the input space. Topology preservation
means that input patterns which are near in the input space are mapped into the
neighbour units in the SOM lattice, where the units are organized into a regular N-
dimensional grid. Topology preservation is achieved with the introduction of
topological neighborhood that connects the units of the SOM with a neighborhood
function.
The training algorithm of the SOM is based on unsupervised learning, where one
sample, the input vector x(n) from the input space VI, is selected randomly and
compared against the weight vector wi of the unit i the map space VM . The best
matching unit b to given input pattern x(n) is selected using metric based criterion:

x ( n ) − wb ( n) = min { x ( n ) − wi ( n ) } (2)
i∈VM

where the parallel vertical bars denote Euclidean vector norm. Initially all weight
vectors are set with the random selected sample from the training set. During the
Time Series Prediction Using RSOM and Local Models 31

learning phase the weights in the map are updated towards the given input pattern x(n)
according to:

w i ( n + 1) = wi ( n ) + γ ( n) hib ( n )( x ( n ) − wi ( n ) ) (3)

where i∈VM and γ(n) is a scalar valued adaptation gain. The neighborhood function
hib(n) gives the excitation of unit i when the best matching unit is b. If the map is
trained properly, weight vectors specify centers of clusters satisfying the vector
quantization criterion, where we seek to minimize the sum squared distance between
input patterns and weight vectors of the best matching units.

3.2 Recurrent SOM

Recurrent SOM differs from the SOM only in its outputs. The outputs of the normal
SOM are reseted to zero after presenting each input pattern and selecting best matching
unit with the typical winner takes all strategy. Hence the map is sensitive only to the
last input pattern. In the RSOM the sharp outputs are replaced with leaky integrator
outputs, which once activated gradually lose their activity.
The modeling of the outputs in RSOM is close to the behavior of natural neurons,
which retain an electrical potential on their membranes with decay. In the RSOM this
decay is modeled with the difference equation:

yi ( n ) = (1 − α ) yi ( n − 1) + α ( x ( n ) − wi ( n ) ) (4)

where 0 < α ≤ 1 is a leaking coefficient, y(n) is a leaked difference vector, wi(n) is the
reference or weight vector in the unit i and x(n) is the input pattern. Fig. 2 shows
design of the output node in RSOM network.

Fig. 2. Structure of RSOM node with feedback.

High value of α corresponds to short memory while small values of α correspond


to long memory and slow decay of activation. In the extremes of α, RSOM behaves
32 Peter Angelovič

like a normal SOM (α = 1), while in the other extreme all units tend to the mean of the
input data.
Since feedback in RSOM contains vector, it also captures the direction of the
error, which can be exploited in weight update when the map is trained. The best
matching unit b at step n is searched by the equation:

yb = min{ yi ( n) } (5)
i

Then the map is trained with modified Hebbian training rule given in Eq. (3),
where the difference vector (x(n) - wi(n)) is replaced with yi .

3.3 Temporal quantization

Learning algorithm of RSOM is implemented as follows [5]:


1. An episode of consecutive input vectors starting from the data is presented to
the map. We use certain number of iterations, because effect of the feedback
in RSOM goes quickly toward to zero. The number of vectors belonging to
the episode is dependent on the leaking coefficient α.
2. Best matching unit is selected at the end of every episode using Eq. (5).
3. The updating of the vector and its neighbors is carried out as in Eq. (3).
4. After the updating, all difference vectors are set to zero, and a new random
starting point from the series is selected.
The above scenario is repeated until the mapping is formed.
Whole procedure of building models and evaluating their prediction abilities with
testing data follows these steps: The time series is first divided into training and testing
data. RSOM is used to divide data into local data sets according to the best matching
unit on the map. Local models, which have the same number of parameters as the
vectors of RSOM units, are then estimated according to these local data sets. In the
training phase the new sample from the test data set is presented into RSOM. Finally,
the best model is selected. This model is then used to predict next value in time series.

4 Experiments
Prediction skills of system based on RSOM and local models were validated on time
series of energy consumption. The results were compared to the other prediction
systems based on global models such as MLP and FIR MLP.
Time series include 1179 training samples (days) and 7 test samples. The input
vector was formed from 28 values as follows: 24 hourly values of energy consumption
one day before, 3 values represented the code of the predicted day and the last value
Time Series Prediction Using RSOM and Local Models 33

was effective temperature1. The output vector included 24 values of hourly energy
consumption of predicted day.
Measuring and comparing prediction results were made using methods for
evaluating errors such as: Mean Square Error (MSE), Maximal Absolute Deviation
(MAD) and Mean Absolute Percentage Error (MAPE).
Influence of leaking coefficient (LC) and number of local models (NLM) were
observed during experiments. The best results are shown in Table 1. Whole
composition and sequence of experiments are in [1].

Table 1. Best prediction results for different number of local models.


NLM LC MSE MAD MAPE [%]
2 0,78 0,00169 0,1945 2,28
3 0,95 0,00183 0,2113 2,304
4 0,95 0,00147 0,1642 2,08

The above table shows that the best result was reached using 4 local models and
0,95 as a value of leaking coefficient. The final prediction of testing data is on Fig. 3.

Fig. 3. Comparison of predicted and real values of tested samples. The grey line
represents the real values and black line represents the predicted values.
All values are transformed into the <0, 1> interval.

Experiments using other prediction methods were made at the same time as
experiments with RSOM and local models. The main motivation for comparing these
models was showing the fact that local models are more accurately for modeling such
nonlinear time series. Results of this comparison are shown in Table 2.

1
Concept of forming the code of the day and computation of effective temperature is shown in
[1] and [8].
34 Peter Angelovič

Table 2. Comparison of prediction results with other methods.


Method MSE MAO MAPE [%]
MLP 0,00617 0,4214 3,52
FIR MLP 0,00138 0,1637 2,14
RSOM + LM 0,00147 0,1642 2,08

5 Conclusions
Prediction system based on RSOM and local models was used for prediction of energy
consumption. Best results were achieved with 4 local models. This result captures the
fact mentioned in [8], that samples (days) of energy consumption time series can be
divided into 4 different groups, according to the type of the day (working day, holiday,
day before or after the holiday). In global, the results of the system are better or
comparable with other prediction methods.
Usage of prediction system based on RSOM has several advantages. First of all, it
is small computing complexity opposite to the global models. Next property is the
unsupervised learning of the context from the data. It allows building models from the
data with only a little a priori knowledge. An important property of RSOM is its
visualization ability. It is possible to visualize the local models, and give
comprehensible information to the user of the system to understand the time series.

References
1. Angelovič, P.: Využitie neurónových sietí s nekontrolovaným učením pri predikcii
časových radov. Diplomová práca, Košice: FEI TU, 2003.
2. Barreto, G., Araujo, A.: Time in self-organizing maps: an overview of models.
International Journal of Computer Research, Vol. 10, No. 2 (2001), 139-179.
3. Box, G., Jenkins, G., Reinsel G.: Time Series Analysis: Forecasting and Control.
Prentice Hall, Englewood Cliffs, New Jersey, 1994.
4. Kvasnička, V., Beňušková, Ľ., Pospíchal, J., Farkaš, I., Tiňo, P., Kráľ, A.: Úvod do
teórie neurónových sietí. Bratislava: Iris, 1997. ISBN 80-88778-30-1.
5. Koskela, T., Varsta, M., Heikkonen, J., Kaski, K.: Temporal sequence processing
using recurrent SOM. Helsinki University of Technology, 1998.
6. McNames, J.: Innovations in local modelling for time series prediction.
Dissertation, Stanford University, 1999.
7. Paralič, J.: Objavovanie znalostí v databázach. Košice: Elfa, 2002. ISBN 80-
89066-60-7.
8. Szathmáry P., Kolcun, M.: Predikcia denných diagramov zaťaženia ES s využitím
umelých neurónových sietí. Košice: Elfa, 2001. ISBN 80-88964-80-6.
Analysis of Massive Networks
György FRIVOLT∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
frivolt@fiit.stuba.sk

Abstract. Massive networks can be observed from various aspects of


the world. Nowadays more massive networks have measurable and
analyzable form: informational networks such as the WWW, networks
of social interactions like call or SMS graphs can be captured. We
give an overview of operations, representations and tools for modeling
graphs. The intention is to build a basis for further development of a
tool for analyzing massive graphs. Finally we introduce some
introductory measured properties of a network of SMS
communication.

1 Introduction
Those networks which are interesting for research usually perform huge number of
vertices and edges. The huge amount of data forces us to think about how to tackle
special and computational complexity. Often the data does not fit the system memory.
Just for a glance: the crawls of a search engine has to process around 200 million web
pages and 2 billion hyperlinks [Newman2003, page 10], the number of
communications in a phone network can scale as 50 million for a month.
There are some ongoing project dealing with massive network analysis and
visualization (Pajek, JUNG, InFlow, DyNet, Cyram NetMiner, etc.). There are
functionalities which are usually aimed by these products.
• Scalability - the range of network size the software can cope with
• Analysis of functionalities - ranking vertices according to their importance,
centrality measurements, clustering


Supervisor doc. Ing. Bieliková, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 35-40.


36 György Frivolt

• Dynamic network modeling - analysis of changes in network over time,


network evolution prediction functionalities
• Graph generation - utilities for graph generation, small-world networks,
scale-free graphs
• Graph visualization - approaches for visualization of the graph, providing
different layouts
Most of the products provide the possibility to export graphs to different formats
(GraphML, GraphEd, GML, Graphviz dot, etc.). Naturally for software products the
licensing is also an important matter of discussion. There are products both freely
available for non-commercial purposes (Pajek) or commercial software (Cyram
NetMiner).
Analysis of a software product for network analysis will be described further. An
approach for cluster-cutting will be described and measured values of clustering
coefficient and average degree of SMS network is served. We conclude the paper with
listing further goals.

2 Operations on graphs

2.1 Representations

We distinguish the following types of graph representation (providing different


interfaces) useful for different operations:
• Database storage – The primary way of representation of the graph is to store
it in a well indexed database. The neighbors of any selected vertex should be
simply selectable.
• Vector structure – For every vertex a list of its neighbor vertices is stored in
the memory.
• Matrix representation - The adjacency matrix serves much better
representation of graph for several operations. The co-citation matrix or
importance ranking algorithm PageRank and HITS are defined for operating
on adjacency matrixes. However, as most of the real networks are sparse,
therefore there is a huge waste of the system memory when bigger portion of
a massive graph is represented as matrix. The possibility to store the graph as
a list of vectors and operating with it as a matrix would be the best
compromise.
Analysis of Massive Networks 37

2.2 Manipulations

Performing graph manipulation can involve two different type of processing of the
graph:
• Generate-mode - A new graph is produced, which is completely independent
of the originally processed one. Generation of a graph from the source graph
causes computational effort when it is executed, but every operation is
performed on the produced graph afterwards.
• Wrap-mode - The graph manipulation decorates the graph under processing
and does not create physically any graph. The produced graph is a kind of a
view of the processed graph. This mode causes small effort when it is
executed, but less computation when the produced graph is being processed.
Also the spatial demands of this operation should be much smaller, as no
graph is generated.

2.3 Operations

Graph operations should serve a basis for making decisions for the user or should
present a list of results which helps navigation in the network. The following
operations were chosen as probably the most relevant for these purposes.
• Clustering – Identification of clusters/community structures in the network.
The input of the clustering operation is a graph and generates a list of clusters,
with vertices they contain, and a hierarchy of clusters.
• Shrinking – Shrinking sets of vertices to one vertex, for instance shrinking
identified clusters to vertices.
• Filtering – Operations for filtering out edges and vertices with given criteria.
• Co-citation network – Operation over the adjacency matrix: E T E
• Ranking – Implementation of vertex/edge importance ranking, such as
centrality measurements [1], PageRank [6] or HITS [2]
Shrinking, clustering and generation of cluster hierarchy are operations of global
decomposition. Local decompositions are cutting out a part of the graph (for instance
vertices of a component) or shrinking all but one cluster produces a context of the left
alone cluster. Fig. 1 shows an illustration of the decompositions.
Local cluster cutting operation produces a subgraph of the input graph, which is
exploited based on an initial seed of vertices.
38 György Frivolt

Fig. 1. Graph operations.

2.4 A cluster-cutting approach

Changing the graph database representation to matrix or vector representation may not
be always straightforward. The intention of storing the graph in database is keep
possibly the all graph on an external storage. For the most of the graphs the network
stored externally does not fit the memory, therefore approach for cutting out a portion
of the whole data set needs to be proposed.
Our approach is a modified breath-first search algorithm. Whereas the BFS search
prioritizes the vertices based on the distance from the seed vertices, we propose to
consider priorities also as the rate of the number of neighbors already cut-out to the
total number of adjacent vertices.
Analysis of Massive Networks 39

Requires: graph G(V,E), seed of initcial vertices S, maximum


number of vertices to cut L
Ensures: set of cut-out vertices C
C=S
list = S
while list is not empty and |C|<L:
v = pop(list )
add v to C
for all neighbours k of v:
if k in list:
rerank k in list with priority:
number _ of _ k _ neighours _ in _ C
total _ number _ of _ k _ neighbors
else:
add k to list with priority:
1
total _ number _ of _ k _ neighbors
return C
Alg. 1. Finding cut-out vertices.

3 Analysis of SMS communication network


A simple strategy to cope the huge amount of data was used by us to get some
properties of the network of SMS communication. The network contained over 15
million edges/SMS communications, only the evidence of one communication was
captured in the dataset, therefore the real number of SMS messages could be much
higher. The analyzed graph was undirected, any communication from actor a to b
was considered as edge {a, b} without orientation. The communication was captured
over one month. The identification of the communication actors were coded, therefore
no personal rights could be disused.
Our primary intention was to touch the data set to get the first impression about its
processing. We used a mysql database table with two columns as data storage. The two
columns coded the initiator and the target phone number. Although the network could
be taken as directed, we did not take any advantage of the orientation of the edges. The
data processing was implemented in python.
We measured the clusterization coefficient [WattsStrogatz98], average degree.
Randomly chosen vertices were analyzed against the target network properties.
The computation was executed on computer with processor Intel Centrino
1.4GHz, 512Mb RAM, sufficient HDD space, with Linux OS. The clusterization
coefficient have been found 0.131 for the SMS communication network, which is
significantly higher as it would be expected for random graphs. This property of the
graph means, that in general more than 13% of those people who we send SMS
40 György Frivolt

messages also send messages among each other. The average number of “SMS
neighbors”, the average degree of the graph was found to be 6. The computation took 6
hours, 37 minutes. This time will have to be reduced in the future by processing the
data set in the memory.

4 Conclusions
We presented a short description of functionalities required by tool for massive graph
analysis. An algorithm for cutting out a part of the graph was proposed. This algorithm
is necessary for finding a portion of the graph based on the given initial seed, which
can be further processed in the system memory. Finally some first results of the graph
were presented.
The proposed algorithm for graph cutting has to be tested on real data set. There
are also other properties of the graph which are worth of measuring: degree
distribution, degree-correlation [3]. Our main goal is to identify the network clusters
and rank the importance of network vertices and edges.

Acknowledgement: This work was supported by Science and Technology Assistance


Agency under the contract No. APVT-20-007104.

References
1. Brandes U.: A Faster Algorithm for Betweenness Centrality. Journal of
Mathematical Sociology, Vol. 25 (2001), 163-177.
2. Kleinberg J.M.: Authoritative Sources in a Hyperlinked Environment. Journal of
the ACM, Vol. 46 (1999), 604-632,
3. Newman, M.E.J.: Assortative mixing in networks. Int. Physical Review Letters,
Vol. 89, No. 20 (2002), cond-mat/208701
4. Newman, M.E.J.: The structure and function of complex networks. Int. Physical
Review Letters (2003), cond-mat/0303516
5. Watts, D.J., Strogatz, S.H.: Collective dynamics of small-world networks. Int.
Nature, Vol. 393, (1998), 440-442.
6. Page L., Brin S., Motwani, R., Winograd T.: The PageRank Citation Ranking:
Bringing Order to the Web, Standford Digital Libraries, Technologies Project
(1998), unpublished
An Emergence of Game Strategy
in Multiagent Systems
Peter LACKO∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
lacko@fiit.stuba.sk

Abstract. In this paper, we study an emergence of game strategy in


multiagent systems. Symbolic and subsymbolic approaches are
compared. Symbolic approach is represented by a backtrack algorithm
with specified search depth, whereas the subsymbolic approach is
represented by feedforward neural networks that are adapted by
reinforcement temporal difference TD(lambda) technique. As a test
game, we used simplified checkers. Three different strategies were
used. The first strategy corresponds to a single agent that repeatedly
plays games against MinMax version of a backtrack search method.
The second strategy corresponds to single agents that are repeatedly
playing a megatournament. The third strategy is an evolutionary
modification of the second one. It is demonstrated that all these
approaches led to a population of agents very successfully playing
checkers against a backtrack algorithm with the search depth 3.

1 Introduction
Applications of TD(λ) reinforcement learning [2, 3] to computational studies of
emergence of game strategies were initiated by Gerald Tesauro [4, 5] in 1992. He let a
machine-learning program endowed with feed-forward neural network to play against
itself a backgammon game. Tesauro has observed that a neural network emerged,
which is able to play backgammon on a supreme champion level.
The purpose of this paper is to use TD(λ) reinforcement learning method and
evolutionary optimization for adaptation of feed-forward neural networks that are used
as evaluators of next possible positions created from a given position by permitted
moves. Neural network evaluates each position by a score – number from an open


Supervisor: prof. Ing. Vladimír Kvasnička, DrSc., Institute of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 41-48.


42 Peter Lacko

interval (0,1). A position with the largest score is selected as the forthcoming position,
while other moves are ignored. The method is tested on a simplified game of checkers,
where that player wins, whose piece first reaches any of the squares on the opposite
end of the game board. Three different experiments are done. The first experiment uses
only one neural network playing a game against a player simulated by a MinMax
backtrack algorithm with the search depth 3. The second experiment corresponds to a
population of neural networks, which are repeatedly playing a megatournament (each
network against all others). After each game both neural networks are adapted by
TD(λ) according to the result of the game. Finally, the third experiment uses
evolutionary adaptation of neural networks, i.e. reinforcement learning was substituted
by random mutations and natural selection. In all three experiments, the emerged
neural networks won about 60% of games of simplified checkers against MinMax
algorithm with the search depth 3.

2 Simplified game of checkers


The game of checkers is played on a square board with sixty-four smaller squares
arranged in an 8×8 grid of alternating colors (like chess board). The starting position is
with each player having 8 pieces (black, respectively white), on the 8 squares of the
same color closest to his edge of the board. Each must make one move per turn. The
pieces move one square, diagonally, forward. A piece can only move to a vacant
square. One captures an opponent's piece by jumping over it, diagonally, to the
adjacent vacant square. If a player can jump, he must. A player wins, if one of his/her
pieces reaches a square on the opponent's edge of the board, or captures the last
opponent's piece, or blocks all opponent's moves.

2.1. Formalization of game

In this section, we shall deal with a formalization of the game of checkers, which can
be applied to all symmetric two player games (chess, go, backgammon, etc.). Let the
current position of the game be described by a variable P, this position can be changed
by permitted actions – moves constituting a set A(P). Using a move a′∈A(P), the
a′
position P shall be transformed into a new position P′, P ⎯⎯ → P ′ . An inverse
position P is obtainable from a position P by switching the color of all black pieces to
white and of all white pieces to black. We shall use a multiagent approach, and we
shall presume, that the game is played by two agents G1 and G2, which are endowed
with cognitive devices, by which they are able to evaluate next positions.
Algorithm
1. step. The game is started by the first player, G←G1, from a starting position,
P←Pini.
An Emergence of Game Strategy in Multiagent Systems 43

2. step. The player G generates from the position P a set of the next permitted
positions A ( P ) = { P1 , P2 ,..., Pn } . Each such position Pi from the set of
these positions is evaluated by a coefficient 0<zi<1. The player selects as
his next position such P´∈A(P), which is evaluated by the maximum
coefficient, P←P´. If the position P satisfies condition for victory, then the
player G wins and the game continues with the step 4.
3. step. The other player takes turn in the game, G ← G2 , the position P is
generated from the inverse of the current position, P ← P , the game
continues with the step 2.
4. step. End of the game.

The key role in the algorithm plays the calculation of coefficients z=z(P′) for
positions P′∈A(P). These calculations can be done either by methods of classical
artificial intelligence, based on a combination of depth first search and various
heuristics, or by soft computing methods. We shall use the second approach, where we
shall turn our attention to modern approach of multiagent systems. It is based on a
presumption, that the behavior of an agent in his/her environment and/or certain
actions he/she performs are fully determined by his/her cognitive device, which
demonstrates a certain plasticity (i.e. it is capable of learning).

z(P)
output neuron (1)
information flow

y ............ hidden neurons (p)

............ input neurons (32)


x(P)
Fig. 1. Feed forward neural network with one layer of hidden neurons. The input
activities are equivalent to 32-dimensional vector x(P), which codes a position
of the game. The output activity equals to the real number z(P) from
the open interval (0,1), this number is an evaluation of the input position.

3 The structure of the cognitive device – neural network


Firstly, before we shall specify the cognitive device of agents, we have to introduce the
so-called numerical representation of positions. Position is represented by a 32-
dimensional vector
x ( P ) = ( x1 , x2 ,..., x32 ) ∈ {0 ,1, − 1}
32
(1a)
where single entries specify single squares at the position P of the game
44 Peter Lacko

xi = {0 ( ith square is free ) , ± 1 ( on ith square is our/opponent's piece )} (1b)

The used neural network has the architecture of a „feed-forward network“ with one
layer of hidden neurons. The activities of input neurons are determined by a numerical
representation x(P) of the given position P, the output activity evaluates the position
x(P) (see fig. 1). The number of parameters of the neural network is 34p+1, where p is
the number of hidden neurons

4 Adaptation of cognitive device of agent with temporal difference


TD(λ)-method with reward and punishment [2]
In this section we shall give the basic principles of the used reinforcement learning
method, which currently in its temporal difference TD(λ) version belongs to effective
algorithmic tools for adaptation of cognitive devices of multiagent systems. The basic
principles of reinforcement learning are following: Agent observes the mapping of
his/her input pattern to his/her output signal of his/her cognitive device (the output
signal is often called an „action“ or „control signal“). Agent evaluates the quality of the
output signal on the basis of the external scalar signal „reward“. The aim of the
learning is such an adaptation of the cognitive organ of the agent, which will modify
the output signals toward maximization of external „reward“ signals. In many cases the
„reward“ signal is delayed, it arrives only at the end of a long sequence of actions and
it can be understood as the evaluation of the whole sequence of actions, whether the
sequence achieved the desired goal or not.
In this section we shall outline the construction of TD(λ) method as a certain
generalization of a standard method of gradient descent learning of neural networks.
Let us presume, that we know the sequence of positions of the given agent - player and
their evaluation by a real number z
P1 , P2 ,..., Pm , zreward (2)
where zreward is an external evaluation of the sequence and corresponds to the fact,
that the last position Pm means that the given agent won, or lost
zreward = {1 ( sequence of positions won ) , −1 ( sequence of positions lost )} (3)
From the sequence (2) we shall create m couples of positions and their
evaluations by zreward, which shall be used as training set for the following objective
function
2
1 m
E ( w ) = ∑ ( z reward − G ( xt ; w ) ) (4)
2 t =1
We shall look for such weight coefficients of the neural network – cognitive
device, which will minimize the objective function. When we would find out such
weight coefficients of the network that the function would be zero, then each position
from the sequence (2) is evaluated by a number zreward. The recurrent formula for
adaptation of the weight coefficients is as follows
∂E
w: = w − α = w + ∆w (5)
∂w
An Emergence of Game Strategy in Multiagent Systems 45

m
∂z t
∆ w = α ∑ ( z reward − z t ) (6)
t =1 ∂w
where zt=G(Pi,w) is an evaluation of tth position Pt by neural network working as
a cognitive device. Our goal will be, that all the positions from the sequence (2) would
be evaluated by the same number zreward, which specifies, if outcome of the game
consisting from the sequence (2) was a win, draw, or loss for the given player. This
approach can be generalized to a formula, which creates the basis of the TD(λ) class of
learning methods [2]
m
∆ w = ∑ ∆ wt (7)
t =1
t
∂z k
∆ wt = α (z t +1 − z t )∑ λ t − k (8)
k =1 ∂w
where the parameter 0≤λ≤1.
Formulas (7) and (8) enable a recurrent calculation of the increment ∆w. We
shall introduce a new symbol et(λ), which can be easily calculated recurrently
t
∂z ∂z
e t (λ ) = ∑ λ t − k k ⇒ e t +1 (λ ) = λe t (λ ) + t +1 (9)
k =1 ∂w ∂w
where e1 (λ ) = ∂ z1 ∂ w . Then the single „partial” increments ∆wt are determined
as follows
∆ wt = α (z t +1 − z t )e t (λ ) (10)

5 Results
For measurement of game strategy emergency success we used MinMax algorith [1].In
our implementation, we used the following heuristic function:
l m
evaluation = ∑ yn [i ] −∑ ( 8 − ys [i ]) (11)
i =1 i =1
If we denote the number of our pieces on a game board l and the number of
opponent’s pieces m, then we can denote by yn[i] the position of our ith piece along the
y axis (the axis towards the opponent’s starting part of game board). By ys[i] we can
denote equivalent value of the opponent’s pieces.
This evaluation ensures that the MinMax will try to get its pieces toward the
opponent’s part of the game board and it will try to prevent the opponent’s progress.
The play of our player is quite offensive.

5.1 The result of a supervised learning of neural network


In our first, simplest approach, we considered only a 1-agent system. Our agent learns
by playing against another agent, whose decisions are based on backtrack search to
a maximum depth 3. The game is repeated with players alternating to go first. After
each end of the game, the agent with a cognitive device represented by a neural
network adapts his/her neural network by a reinforcemernt learning method using
reward/ punishment signal.
46 Peter Lacko

For training and testing we used a two-layered feed-forward network with 64


hidden neurons, the learning rate 0.01 and the coefficient λ=0.9. The network learned
after each game, when it was evaluated by 1 if it won, and 0 evaluated it if it lost. After
each 100 games, the ratio of won/lost games was marked on the graph. In the trial, the
network played against the MinMax algorithm searching to the level 3. The graph of
the learning progress is shown on the fig. 2. It is evident, that the network learned
slowly and even after 450000 matches achieved victory only in 65% of matches.
Nevertheless, it is still an excellent result, since if the network would play as well as
our MinMax algorithm searching to the level 3, it would win only 50% of matches.

Fig. 2. The progress of learning of neural network playing against the MinMax
algorithm with the search depth 3.

5.2 The result of adaptation of a population of neural networks

In the second, more complicated case, we consider a multiagent system. Its agents
repeatedly play against each other a megatournament, while after each game the neural
networks of both agents are adapted by a reinforcement learning method. For this trial,
we used 20 neural networks. These networks played a megatournament against each
other, and their level of development was measured by a tournament against MinMax
with search depth 3. The learning curve is shown on the fig. 3. The figure shows, that
even though the neural networks were not taught by TD(λ) learning against the
MinMax algorithm, they did learn to play checkers. It means that we did not need an
expert with a good knowledge to teach the networks how to play.

5.3 The result of evolutionary adaptation of a population of neural


networks
In the third, most complex approach, we used in a multiagent system also a Darwinian
evolution; after the end of each megatournament agents are evaluated by a fitness
according to their success rate in the game and they further quasirandomly reproduce
with a probability proportional to their fitness. In this case, we use asexual
reproduction, where we create a copy of the parental agent. This copy is with a certain
probability mutated and replaces some weak agent in the population. To assess fitness
An Emergence of Game Strategy in Multiagent Systems 47

we used the MinMax with search depth 3. The figure 5 shows a learning curve as an
average result of the agents from the population against MinMax with search depth 3.
The population consisted of 55 agents, from which in each epoch a subpopulation of 10
individuals was created. The subpopulation was generated by a quasirandom selection
of agents from the population, which were mutated with a probability 0.5. The
mutation added to each weight of neural network with a 0.001 probability a random
number from a logistic distribution with a parameter 0.1. This subpopulation then
replaced the weak individuals in the population. The figure 4 shows, that even in this
approach a strategy of the game emerged, and resulting neural networks were able to
play at the same level as the MinMax algorithm with a depth-search 3.

Fig. 3. The progress of learning in a population of 20 neural networks trained by


TD(λ). The curve shows an average percentage for the whole population
of wins to losses against the MinMax with search depth 3.

Fig. 4. The progress of learning of a population of 55 neural networks adapted by


evolutionary algorithm. The curve shows an average percentage of wins
for the whole population against the MinMax with search depth 3.
48 Peter Lacko

6 Conclusions
The purpose of this paper is a computational study of game-strategy emergence for a
simplified game of checkers. It was studied at three different levels. At the first
simplest level we have studied a simple 1-agent system, where an agent (represented
by a neural network) plays against another agent, which is simulated by MinMax
backtrack method with a specified search depth of 3. At the second level, we used a
genuine multiagent system, where agents play repeatedly a megatournament, each
agent against all other agents. After finishing each single game, both participating
agents modify their neural networks by TD(λ) reinforcement learning. At the third
level, a Darwinian evolution is used for all agents from a population (multiagent
systems). In a similar way as at the previous second level, agents play also a
megatournament; its results are used for fitness evaluation of agents. The fitness values
are used in the evolutionary approach for a reproduction process of agents, when fitter
agents are reproduced with a higher probability than weaker agents. In the reproduction
process the weight coefficient are softly randomly modified – mutated, where natural
selection ensures that only better neural networks survive. At all three levels we
observed an emergence of checker game strategy, where at the second and third level
we did not use any user defined agents that are endowed with an ability to predict a
correct strategy and are therefore able to play the game perfectly. This is a very
important moment in our computer simulations; in the used multiagent systems, an
emergence of game strategy is spontaneous and not biased by predefined opponents
that are able to play the game perfectly. Neural networks are able to learn a strategy,
which gives rise to agents with capabilities to play checkers at a very good level.

Acknowledgment: This work was supported by Scientific Grant Agency of Slovak


Republic under grants #1/0062/03 and #1/1047/04.

References
1. Russell, S.J., Norvig, P.: Artificial Intelligence: Modern Approach. Upper Saddle
River, HJ: Prentice Hall, 1995.
2. Sutton, R.S.: Learning to predict by the method of temporal differences. Machine
Learning, Vol. 3 (1988), 9-44.
3. Sutton, R.S., Barto, A.G.: Reinforcement Learning: An Introduction. Cambridge,
MA: MIT Press, 1998.
4. Tesauro, G.J.: Practical issues in temporal difference learning. Machine Learning,
Vol. 8 (1992), 257-277.
5. Tesauro, G.J.: TD-gammon, a self-teaching backgammon program, achieves
master-level play. Neural Computation, Vol. 6, No. 2 (1994), 215-219.
Optimising Multi-Agent Cooperation
Using Evolutionary Algorithm
Marián LEKAVÝ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
lekavy@fiit.stuba.sk

Abstract. This paper describes our experiments with the use of


evolutionary approach for offline learning of strategic plans in a multi-
agent system. We focused on the domain of simulated robotic soccer,
where the environment is only partially observable and
nondeterministic. We used evolutionary algorithm for learning set
plays – sequences of actions as a reaction for a specific situation. In
each agent, a separate evolutionary algorithm optimises agent’s
actions according to fitness function common for all agents. The
approach was able to overcome non-determinism of the environment
and find successful strategies against particular opponent.

1 Introduction
In year 1995 the idea of RoboCup was born [1]. The main goal of the RoboCup
initiative is to create a team of fully autonomous robots, which would be able to win
the soccer world championship (with human opponents) by the year 2050. In order to
accomplish this task, many new improvements have to be made, especially in robotics
and artificial intelligence. At the same time, soccer is one of the most (if not the most)
popular sports all over the world, making RoboCup interesting for the wide public.
And this is the ultimate goal of RoboCup: to foster the research, to wake up interest in
robotics and artificial intelligence in scientists and non-scientists.
The players act in a real environment, which means that the information provided
by their sensors is both inaccurate and incomplete, so the players often need to make
their decisions without all the necessary information. At the same time, actions carried
out by the players are subject to random noise, so the result of an action is only partly


Supervisor: prof. Ing. Pavol Návrat, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 49-56.


50 Marián Lekavý

predictable. The predictability of the environment gets even lower, as there are 11
opponent players trying to achieve an opposite goal. Other important constrain is the
need to act in real-time, making it hard to use several techniques like deliberation
methods or state-space search (especially when the state-space becomes as vast as to be
practically infinite).
Many players in the RoboCup simulation league (but also in other leagues)
consist, more or less, of three basic control layers: basic skills, tactics and strategy.
Basic skills are responsible for simple tasks like running to a place or kicking the ball.
These basic skills form the action primitives in the simulation league. In not-simulated
leagues, the basic skills can be further broken-down into more primitive actions, like
powering-up and -down physical engines. The basic skills are used by the player’s
tactical layer. The tactics decides what sequence of basic actions has to be executed in
order to fulfil a given task. These tasks are usually defined in terms of a specific
domain. In the domain of robotic soccer, these are tasks like “gain the ball”, “defend
opponent player” or “move to home position”. While tactic layer decides, how to fulfil
a given task, the strategic layer decides, what tasks have to be fulfilled in order to fulfil
a given goal. Primitives for player’s strategy are tactic tasks.
The strategic control of a player can range from simple decision tree providing
reactive control to complex deliberative methods. A commonly used strategic method
is space decomposition by formation or other positioning policy. Other interesting
method is central planning done by team coach at run-time, making it possible to create
a plan for the whole team few times during the game. This is however limited by low
communication bandwidth of the coach. Next possibility is to use a Locker-Room
Agreement or similar approaches, making the players execute specific sequences of
actions at a specific situation [2, 3].
In Locker-Room Agreement, the most important issue is how to find appropriate
strategies for reacting to a standard situation. These standard situations are called set-
plays and have an important role in a soccer game. There are several standard
situations, like kick-off, free-kick or corner-kick. One possibility is to use hand-made
strategies, which contain domain knowledge of their creators. However creating them
by hand means great amount of human work. We explored the possibilities of
automated creation of these strategies. This paper describes our experiments with using
of evolutionary and co-evolutionary algorithm to optimise players’ actions in a
standard set-play. The experiments were carried out using the Leaky Cleats (in original
Deravá Kopačka) simulated soccer player [6].
The experiments use our own approach based on evolution, which enables
automated learning of strategies for set-plays. The learned strategies can be then used
during the game to improve players’ performance. The approach is not fully tested yet
and still under development. It yielded, however, good results and seems to be a good
start for further development. Therefore, this paper can be seen as a progress report.
Optimising Multi-Agent Cooperation Using Evolutionary Algorithm 51

2 Used approach
As the base for the used approach, a “standard” evolutionary algorithm scheme was
used [4]. It consists of the following steps:
1. Generate initial population;
2. Generate offspring;
3. Evaluate fitness;
4. Choose next generation from the population and offspring;
5. Repeat steps 2 to 4 while the termination condition is not fulfilled.
In the following text, individual parts of the evolutionary algorithm will be
described, as we applied it to the domain of set-plays in simulated soccer.

2.1 Chromosomes

The main goal of the algorithm is to evolve a reaction to a standard situation.


Therefore, the basic part, a chromosome, of an individual in the population is a
sequence of actions that have to be carried out as a reaction to the standard situation.
Each chromosome represents the actions of exactly one player.
The sequence consists of passes to other teammates. An example sequence can be
seen in figure 1. Each gene in a chromosome consists of 3 parts: number of player to
pass to; offset of the pass; time (counted in game cycles) for which the gene is valid.
The number of genes in a chromosome is variable. During a game, each player acts
according to one chromosome, different for each player.

player number 3 7 2 ...


offset (2; 0.5) (4; 0) (-2; 1) ...
activity time 5 14 12 ...
Fig. 1. An example of a chromosome, consisting of multiple genes with player number,
pass offset and time for which the gene is active during the game. During a game,
each player acts according to one chromosome, different for each player.

The first gene in figure 1, for example, says that for the first 5 cycles of the set-
play, the player tries to pass to player number 3. The pass doesn’t go directly towards
the player 3, but is shifted (has an offset) 2 metres forward and 50 centimetres left. For
the next 14 cycles, the second gene is active, which means that the player will pass 4
metres in front of the player 7.
Only the passes were controlled by the chromosomes. When the player was able
to kick the ball, he passed according to the currently active gene in his chromosome.
Whenever the player was not in possession of the ball, he carried out actions
determined by players default logic, like holding formation, intercepting ball or
defending an opponent.
52 Marián Lekavý

We chose this representation of an individual because it is able to describe all


possible pass sequences in a game. Moreover, with this representation, the player is
able to react even to non-standard situation, when the pass is intercepted by other
teammate. Other possibility would be to use one chromosome for the whole
population, which would tell the sequence of ball owners. This would, however, be too
restricting and taking the pass by other teammate would mean a failure in execution.
There are latent genes, which do not activate during an execution, because their
activity time expires before the player is able to kick the ball. However, as the
environment is non-deterministic and the opponents unpredictable, there can be non-
standard situations in which the latent genes activate. The latent genes can also hold
information about partial results of the previous evolution, which are not active at the
moment, but can be activated later by change of other genes and improve the evolution
process.

2.2 Population

We used two different approaches: “classical” evolutionary[4] and co-evolutionary[5].


In both cases, chromosomes have the same structure described in the previous chapter
and displayed in figure 1.
In the classical approach, an individual in the population is made up of 11
chromosomes, one chromosome for every player. This is displayed in figure 2.a. Each
individual (group of 11 chromosomes) is evaluated as a compact whole.
In the co-evolutionary alternative, each of the 11 players has its own population
of chromosomes. In this case, one individual equals to one chromosome. In the 11
populations, the evolution runs separately. This can be seen in figure 2.b. For each
evaluation, one individual is chosen from each of the 11 populations. The 11
chromosomes – individuals work together during the evaluation and the success (or
failure) during the evaluation is used as a fitness function of a chromosome in its own
population.
chromosome

individual
...
... ... ... ... ...
population

a b
Fig. 2. Place of chromosomes in the population. In the evolutionary approach (a), 11
chromosomes (one for each player) build-up an individual and all such individuals
belong to the same population. In the co-evolutionary approach, 1 chromosome
equals to 1 individual. All chromosomes for the same player build-up
one population, yielding 11 different populations.
Optimising Multi-Agent Cooperation Using Evolutionary Algorithm 53

2.3 Offspring Generation

The offspring is created by randomly choosing population members and by mutations.


A random member of the population is copied and small mutations are applied to it in
order to create a new individual. Mutations are small changes to chromosomes. These
changes include inserting/deleting a gene to/from a chromosome and mutation of a
gene by changing player number, small change of offset or activity time. Generated
offspring together with the parents are then evaluated to determine their fitness.

2.4 Fitness evaluation

Fitness of chromosomes is evaluated by letting the players to act according to the


chromosomes. In the experiments, 45 cycles of game beginning in a concrete game
situation were played for each evaluation. Most of the experiments were carried out on
a standard kick-off situation; however the approach was also tested on other standard
situations, like corner-kick. The standard situation is repeated each 45 cycles by the
trainer application, allowing it to evaluate one strategy in each 45 cycles of the game.
The evolutionary algorithm tries to optimise players’ behaviour to achieve the
best possible results during these 45 cycles.
When using the standard evolutionary algorithm (figure 2.a), one individual from
the population is selected and evaluated at a time. This individual represents the game
strategy for the standard situation. After 45 cycles of playing according to this strategy,
the success of this strategy is evaluated in the form of fitness function. The resulting
fitness value is then used for the selected individual.
When using the co-evolutionary approach (figure 2.b), one individual from each
of the 11 populations is selected. The 11 selected chromosomes together represent a
game strategy. After 45 cycles of playing according to this strategy, the success is
evaluated in the form of fitness function. The resulting fitness value is then used for all
11 selected chromosomes in their populations.
In order to make the influence of random noise and unpredictability of the
opponents lower, each game strategy is evaluated twice. Because we want to minimise
the use of unreliable strategies, the resulting fitness is computed as minimum of fitness
values gained in individual evaluations. Usage of average or maximum caused
unreliable strategies to survive and lowered the quality of found solutions.

2.5 Fitness function

The fitness function has to be created carefully in order to make the evolution converge
to a good solution. In the domain of simulated soccer, the players have to be able to
score a goal. This means, that the fitness function should include the distance of the
ball and opponent goal. Another important metrics of success is loss of the ball. When
the opponent gets the ball, the strategy can be seen as unsuccessful. Therefore, the
fitness function should also include number of cycles for which the team controlled the
ball.
54 Marián Lekavý

The resulting fitness function is following:


fitness = steps _ controlled _ ball − dist (last _ owned _ ball , opponent _ goal )
where fitness is the resulting fitness value, last_owned_ball is the place where a
teammate last interacted with the ball (place of last ball ownership), opponent_goal is
the place where the opponent goal is located, dist is Euclidean distance and
steps_controlled_bal is number of cycles in which the team controlled the ball (until
lost to an opponent).

3 Results
Both approaches, “classical” evolutionary and co-evolutionary, worked and succeeded
in converging to a solution that fulfils the objectives of the used fitness function. As
only a limited amount of experiments was carried out, it was possible to compare these
two approaches in means of success in finding a working set-play strategy. The co-
evolutionary approach is expected to provide slower convergence, paid back in lower
chance to converge to a local extreme and higher robustness of the found solution.
For finding an appropriate solution, a good fitness function is very important. The
following example shows how fitness function can influence the result of the
evolution: When only ball distance to goal was used as fitness function, a simple
strategy evolved: passing the ball far into opponent territory. This is, of course, a very
poor strategy, as the opponent will gain the ball. It, however, fulfils the fitness
function. After adding number of cycles until loosing the ball, the strategy changed –
the player passed into a free space in opponent territory. It lasted for a long time to an
opponent to get to the ball and the ball was far in opponent half, thus maximising the
fitness function, but not fulfilling the objectives. Another strategy evolved when only
the time until the ball lost was used: players passed deep into own half, into places
where no opponents were placed. These examples show that great care should be given
to fitness function selection as it is of vital importance for good results.
Finally, the following example shows, that even quite complex and working
strategies can evolve using the described approach. Figure 3 shows the sequence of
evolved solutions to the kick-off sequence during one algorithm run. The kick-off
situation implies that all players are on their own halves of the field and our player
makes the kick-off in the centre of the field. At first, random passes were performed, as
the population was randomly initiated. The first strategy found was to pass to the
teammate at the side (figure 3.a). The pass was many times successful, however it was
often intercepted by an opponent. The next solution was passing back and to the side
(figure 3.b). This pass was sometimes intercepted by an opponent, but it was more
reliable. Next improvement found was a pass with negative offset (figure 3.c). The
teammate ran back few metres to get the ball and the opponent had no chance to get the
ball as he had to run a longer way. In the next phase, a pass to own defender and
subsequent pass to the attacker evolved (figure 3.d). It was a progress in getting the
ball to opponent half, but the far passes were few times unsuccessful. The pass–to–side
solution (figure 3.c) was then re-incarnated and improved with a pass forward (figure
Optimising Multi-Agent Cooperation Using Evolutionary Algorithm 55

3.e). This pass was, however, sometimes intercepted, because the attacker running
forward had to run back again and sometimes, he didn’t see the pass while running and
looking forward. Finally, the solution was improved by adding a “loop” of pass back
and forward, that was needed to make the opponents move to places where they didn’t
intercept further passes (figure 3.f). This strategy remained in the population for the
remaining time of the experiment, with minimal modifications. It fulfilled the fitness
objectives – not to loose the ball and to bring the ball forward into opponent half.

a b c

d e f
Fig. 3. Example sequence of evolved solutions for kick-off. Strategies evolve from
simple ones (a) to more complex and better ones. Ball movement is displayed
with thick arrow, thin arrow represents teammates’ movement and dashed
arrow represents opponent players' movement. Only player movement
important for the example is displayed.

4 Conclusions
The approaches seem to work in most cases and deliver usable strategies for set-plays
against one team. It was able to overcome non-determinism of the environment.
Successful strategy evolved in a partially observable environment with random noise.
Experiments with learning strategies against more teams were not carried out and
there could be some difficulties with generalising this approach for more opponents. If
two opponent teams use similar strategies, the solution found for one team could be
used as population initialisation for learning with other team, yielding similar strategy,
but optimised also for the latter team. This, however, can be used only if the two teams
use similar strategies. Other possibility would be to learn more strategies for one
situation and select the appropriate according to an opponent model made during a
56 Marián Lekavý

game. Appropriate strategy could be also selected during a match by simply trying out
different approaches and subsequently using the ones that worked.
The approach is not fully tested yet and still under development. It yielded,
however, good results and seems to be a good start for further development.

Acknowledgement: This work has been partially supported by the Grant Agency of
Slovak Republic grant No. VG1/ 0162/03.

References
1. Kitano, H., Asada, M., Kuniyoshi, Y., Noda, I., Osawa, E.: Robocup: The robot
world cup initiative. In: Proceedings of the IJCAI-95 Workshop on Entertainment
and AI/ALife (1995)
2. Stone, P., Veloso, M.: Task decomposition, dynamic role assignment, and low-
bandwidth communication for real-time strategic teamwork. In: Artificial
Intelligence, Vol. 110, No. 2 (1999), 241-273.
3. Kalyviotis N., Hu H.: A Neural Network decision module for the Adaptive
Strategic Planning Framework in RoboCup. In: Proceedings of International
Symposium on Robotics and Automation, Toluca, Mexico (2002)
4. Kvasnička, V., Pospíchal, J., Tiňo, P.: Evolučné algoritmy. STU, Bratislava, 2000.
5. Potter, M. A.: The Design and Analysis of a Computational Model of Cooperative
Coevolution. PhD thesis, George Mason University, 1997.
6. Lekavý, M., Návrat, P., Kapusta, R., Ulický, M., Košťál, M., Košík, M.:
Multiagent coordination in the domain of robotic soccer. In: ZNALOSTI 2005,
Poster proceedings (2005), 65-68.
Recurrent Neural Network Training
with the Extended Kalman Filter
Peter TREBATICKÝ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
trebaticky@fiit.stuba.sk

Abstract. Recurrent neural networks, in contrast to the classical


feedforward neural networks, better handle inputs that have space-
time structure, e.g. symbolic time series. Since the classic gradient
methods for recurrent neural network training on longer input
sequences converge very poorly and slowly, the alternative
approaches are needed. We describe the principles of the training
method with the Extended Kalman Filter and with its modifications
Unscented Kalman Filter, nprKF and with their joint versions. The
Joint Unscented Kalman Filter was not used for this purpose before.
We compare the performance of these filters and of the classic
Truncated Backpropagation Through Time in an experiment for next-
symbol prediction – word sequence generated by Reber automaton.
All the new filters achieved significantly better results.

1 Introduction
Recurrent neural networks, in contrast to the classical feedforward networks, better
handle inputs that have space-time structure. They can be used to process word
sequences of languages generated by grammars or sequences with chaotic character,
which is very useful for controlling robotic systems or analysing and predicting of
variations in mechanical equipments. Recurrent neural network learning is a very
difficult numerical problem, which approaches very poorly and slowly to satisfactory
results when being solved with the classic gradient optimisation methods on longer
input sequences. That is the reason for searching for the more effective methods of
recurrent network learning.


Supervisor: doc. RNDr. Jiří Pospíchal, DrSc., Institute of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 57-64.


58 Peter Trebatický

This paper presents the principles of various methods based on Kalman filtration
that serve as a better alternative to classic gradient methods. First of all we briefly
introduce the reader into Kalman filtration by describing the original Kalman filter
(section 2). Then we describe the extension of introduced Kalman filter to cope also
with the nonlinear systems. So called the Extended Kalman Filter (EKF) (section 3)
can then be used for the task of neural network training. Furthermore, we describe
relatively new filters: Unscented Kalman Filter (UKF), nprKF, as well as their joint
versions UKFj and nprKFj (sections 4, 5 and 6 respectively). These new filters can be
easily implemented and moreover they provide superior performance, which is
demonstrated by two experiments with next-symbol prediction (section 7). The
interested reader can find the detailed description and formulas of these filters in [6].

2 Kalman Filter
Kalman filter, which is the set of mathematical equations, is considered as one of the
important discoveries in the control theory principles. E. Kalman’s article was
published in the year 1960. Its most immediate applications were in control of complex
dynamic systems, such as manufacturing processes, aircrafts, ships or spaceships (it
was part of the Apollo onboard guidance system). It was and still is frequently used not
only in automation, but also in the graphical and economical applications, etc.
However, the Extended Kalman Filter started to appear in the neural network training
applications only relatively recently, which was caused by the progress of computer
systems development.
System's state vector x k (or simply state) is defined as a minimal set of data that
uniquely describes dynamic system's behaviour, where k denotes discrete time. Simply
put, system's state is a vector containing all the relevant variables of the system [2].
1. Process equation x k = Fk ,k −1 x k −1 + q k −1 , where Fk ,k −1 is the transition
matrix taking the state x k from time k − 1 to time k. The process noise q k
is assumed to be additive, white and Gaussian with zero mean and covariance
matrix Q k .

2. Measurement equation y k = H k x k + rk where y k is observable at time k


and H k is the measurement matrix. The measurement noise rk is also
assumed to be additive, white and Gaussian with zero mean and covariance
matrix R k . The noises rk and q k are uncorrelated.
The Kalman filtering problem lies in jointly solving the process and measurement
equations for the unknown state in an optimal manner. We have to use all the observed
data, comprising of the vectors y 1 , y 2 , K , y k to find the minimum mean-square error
estimate of the state x k for every k ≥ 1 .
Kalman filter functions in two repeating steps [2]:
Recurrent Neural Network Training with the Extended Kalman Filter 59

1. Time update, also called prediction step. Here belong equations:


xˆ k− = Fk ,k −1xˆ k −1 and Pk− = Fk ,k −1Pk −1FkT,k −1 + Q k −1 . That is we compute the
apriori estimation of the state and the error covariance.
2. Measurement update, also called correction step.
[
K k = Pk− H Tk H k Pk− H Tk + R k ]−1
xˆ k = xˆ −k + K k (y k − H k xˆ −k )
Pk = ( I − K k H k )Pk−
We correct the state estimate obtained in the previous step according to the
measurement y k .

3 Extended Kalman Filter


When the model is nonlinear, which is the case of neural networks, we have to extend
Kalman filter using linearization procedure. Resulting filter is then called extended
Kalman filter (EKF) [2].
Neural network is a nonlinear dynamic system that can by described by equations:
x k = x k −1 + q k −1 and y k = h( x k , u k , v k −1 ) + rk
The process equation expresses the state of neural network as a stationary process
corrupted with the process noise qk, where the state of the network x consists of
network weights. Measurement equation expresses the desired output of the network as
a nonlinear function of the input vector uk, of the weight vector xk and for recurrent
networks also of the activations of recurrent neurons from previous step vk-1. This
equation is augmented by the random measurement noise rk . The covariance matrix of
[ ]
the noise rk is R k = E rk rkT and the covariance of the noise q k is Q k = E q k q Tk . [ ]
The basic idea of the extended Kalman filter lies in the linearization of the
measurement equation at each time step around the newest state estimate x̂ k . We use
for this purpose just the first-order Taylor approximation of non-linear equation [2].
We can express the neural network training as a problem of finding the state
estimate x k that minimizes the least-squares error, using all the previous
measurements. We can express the solution of this problem as:
[
K k = Pk H Tk H k Pk H Tk + R k ] xˆ k +1 = xˆ k + K k [y k − h(xˆ k , u k , v k −1 )]
−1

Pk +1 = Pk − K k H k Pk + Q k
where x̂ k is a vector of all the weights, h(.) is a function returning a vector of actual
outputs, y is a vector of desired outputs, K is the so called Kalman gain matrix, P is the
error covariance matrix of the state and H is the measurement matrix (Jacobian).
Matrix H contains partial derivatives of i's output with respect to j's weight. Its
computation is realised either using the Back-propagation algorithm in forward neural
network; or using either Back-propagation Through Time, Truncated Back-propagation
Through Time, or Real-time Recurrent Learning in recurrent network.
60 Peter Trebatický

4 Unscented Kalman Filter


The key element in the EKF method is the development of the covariance matrix P,
which is in every step approximated using the Taylor expansion of nonlinear function,
which relates the network outputs to the weights. The first-order Taylor linearization
provides an insufficiently accurate representation in many cases [4].
The nonlinear generalisation of the Kalman filter, called the Unscented Kalman
filter (UKF), was also used with success in various applications including the recurrent
neural network training [5]. The basic principle of the UKF is conceptually similar to
the EKF, but the implementation is significantly different. No derivatives are needed
(i.e. calculation of Jacobian, or Hessian), only function evaluations, as opposed to the
Taylor approximation.
The basic difference between the EKF and UKF stems from the manner in which
Gaussian random variables (GRV) are represented for propagation through system
dynamics [2]. In the EKF, the state distribution is approximated by GRV, which are
then propagated analytically through the first-order Taylor approximation of the
nonlinear system.
The UKF uses so-called unscented transformation, what is a relatively new
method for calculating the statistics of a random variable, which undergone a nonlinear
transformation [3]. A set of sigma points is chosen so that their sample mean and
sample covariance are the true mean and true covariance, respectively. When
propagated through the true nonlinear system, they capture the posterior mean and
covariance accurately to the second order of Taylor series expansion for any
nonlinearity. The EKF, in contrast, only achieves first-order accuracy.
This method resembles the Monte Carlo-type methods, where many samples are
randomly chosen, which also are propagated through nonlinear transformation. On the
other hand, the sigma points are not chosen randomly, but deterministically and
moreover, the number of sigma points is low: 2n x + 1 , where n x is the dimension of a
random variable (vector) [3].

5 Filter nprKF
The other method, or the other Kalman filter modification is the filter named after its
authors the nprKF [5]. As with the UKF, also with this filter it is not necessary to
calculate derivatives, since the Taylor expansion is in this case replaced by the
Stirling's formula for nonlinear function approximation at the interval, where the
function f is approximated by the second-order terms [4]. This formula may be
interpreted as a Taylor approximation with the derivatives replaced by central divided
differences. The authors worked directly with the Cholesky factors of covariance
matrices in order to achieve numerical stability.
Even though the nprKF authors do not explicitly mention the sigma points, they
in fact also use them and even the same number of them. The analysis in [4] confirms
this, since the state estimate is identical in both filters. But they differ in the covariance
estimation. The nprKF provides slightly better estimate - the differences in covariance
Recurrent Neural Network Training with the Extended Kalman Filter 61

update in comparison with the UKF are in the fourth- and greater-order of the Taylor
expansion. Covariance estimate with the UKF is therefore slightly less accurate and
may sometimes even lead to the non-positive definite estimate [4].

6 Joint versions of Unscented Kalman Filter and the nprKF


When training recurrent neural networks with the UKF or nprKF, it is necessary to
repropagate the network several steps from the past for every sigma point (i.e. with
different weights). The alternative approach lies in including the recurrent neurons
activations in the state vector, when we simultaneously use the filter for weights
estimation as well as the state estimation [5]. It is therefore necessary for thus
formulated problem, which is called the Joint Unscented Kalman Filter (UKFj) or the
Joint nprKF (nprKFj), to change the state equation and hence the filter equations. It is
worth noting that this name is used also for the filter in which the system's state and
inputs are concatenated into single state vector [2]. This is used in the situation when
we do not have the noise-free input into a system. We have not found this filter in the
literature specifically in the context of recurrent neural network training. We have
created it on the basis of similarity with the nprKFj filter described in [5].
The joint version of a filter on one hand increases the computation complexity by
expanding the state vector, on the other hand it simplifies the computation of network
output for various weight vectors (sigma points).

7 Experiments
The main goal of our experiments was to compare the performance of all the
mentioned filters, namely EKF, UKF, nprKF, UKFj and nprKFj, in recurrent neural
network training. In order to linearise a nonlinear system (neural network) in the EKF,
it is necessary to compute the matrix of derivatives of outputs with respect to each
weight. We used the Truncated Backpropagation Through Time (BPTT(h)) for this
purpose according to recommendation in [5].
The next symbol prediction procedure is the following: we present in every time
step the first symbol in order, and the desired network's output is the next symbol in
sequence order. We chose the Elman's network architecture - i.e. the network with one
hidden layer, which is recurrent. The predictive performance was evaluated by the
means of a Normalised Negative Log-likelihood (NNL), calculated over symbolic
sequence from time step t = 1 to T [1]:
T
1
NNL = −
T
∑ log
t =1
| A| p (t ) (s (t ) )

where the base of the logarithm |A| is the number of symbols in the alphabet A
and p ( t ) ( s ( t ) ) is the probability of predicting symbol s (t ) in the time step t. If
NNL = 0, then the network predicts next symbol with 100%, while NNL ≥ 1
corresponds to a very inaccurate prediction (random guessing).
62 Peter Trebatický

0,4
b)
BPTT(h)

Normalised Negative Log-likelihood


0,39

0,38
a)
S nprKFj
EKF
X 0,37
T S UKF
B X B nprKF
P 0,36

P V UKFj

T V 0,35

Ideal
Ideal
0,34

0,33
1000

3000

5000
7000

9000

13000

15000

17000
19000

21000

23000

25000
27000

29000
31000

33000

35000

37000

39000

41000

43000
45000

47000
49000
11000

Fig. 1. The NNL dependence of the next symbol prediction (b) in sequence generated
by Reber automaton (a) on the number of symbols for various recurrent neural network
training methods. The ideal value of NNL for this experiment is also displayed.

7.1 Reber’s language

The training sequence in this experiment was generated by the Reber automaton (Fig.
1a), where the next symbol was chosen with 50% probability from two candidate
symbols, with the exception of cases when the next symbol was B. The Reber's
grammar contains 6 symbols, which we encode using the one-hot encoding and we
present them to the network as its input. This encoding means that a single input is
reserved for each symbol, which we set to 1 and others to 0. The network output is
similarly one-hot encoded.
The prediction of symbols generated by the Reber automaton is a relatively
simple task, since we are able to tell in which state we are solely from the last two
symbols. The problem therefore lies mostly in the “lucky” prediction of one out of two
possibilities, i.e. the neural network after training ought to be able to predict with
which probability each symbol follows. This also results in the fact, that we should not
expect the NNL to be close to zero.
The recurrent neural network with three hidden neurons was trained with each
method. The weight update was performed in every time step. The NNL was computed
for every 1000 symbols. We present the comparison of all the filters by this indicator in
Figure 1b. The graph also contains the curve representing the “ideal” NNL. We obtain
it when we predict the next symbol with the probability precisely 0.5, except for the
cases, when the symbol B follows with the probability 1.
We can clearly see the performance of each method (in the sense of convergence
and final result). The weakest method has shown to be the BPTT(h). The Extended
Kalman Filter converges more quickly and the final result is better by approximately
0.01 in comparison with the BPTT(h). The dominance of the filters UKF, UKFj, nprKF
and nprKFj is evident. The convergence of all these four filters is rapid as opposed to
Recurrent Neural Network Training with the Extended Kalman Filter 63

the BPTT(h), and very quick when compared with the EKF. However, the most
interesting is their final result. The differences are minimal - it is impossible to choose
the “winner”; they all achieved the NNL which is better then “ideal”. We see the
possible explanation of this phenomenon in the fact, that these filters helped the
network to partially learn the system for generating the pseudo-random number applied
during the word creation from Reber language.
0,6 0,6
8 hidden neurons 16 hidden neurons

Normalised Negative Log-likelihood


0,5 0,5
BPTT(h)
BPTT(h)
0,4 0,4

0,3 0,3

EKF
0,2 0,2
EKF
nprKF
nprKF
0,1 0,1
1 2 3 4 5 6 7 8 9 10 11 90 91 92 93 94 95 96 97 98 99100 1 2 3 4 5 6 7 8 9 10 11 90 91 92 93 94 95 96 97 98 99100

Fig. 2. The NNL dependence on the training cycles for various recurrent neural
network training methods for the next symbol prediction in the “laser” sequence.

7.2 Laser in chaotic regime

The predicted sequence is based on real data obtained by quantising activity changes of
laser in chaotic regime [1]. The bounds were chosen for positive small and big activity
change and for negative small and big activity change. One symbol is assigned for each
of these categories. The sequence therefore contains four distinct symbols, where
relatively predictable subsequences are followed by much less predictable events. The
sequence length is 10000 symbols; we can therefore predict 9999 symbols. The aim of
this experiment is the performance comparison of various recurrent neural network
training methods. Since the nprKF is comparable or better than other divided
difference filters (also confirmed in other experiments), we compared it only with the
EKF and BPTT(h).
We have used the training and testing procedure for the next symbol prediction
from this sequence from [1]. We do not update the weights for the first 50 steps in
order to lessen the impact of initial recurrent neurons output values. The training then
takes place during next 7949 symbols. The remaining 2000 symbols forms the test data
set, through which we compute the NNL. That terminates one cycle. Ten cycles are
sufficient for the filters, 100 for the BPTT(h). We have used one-hot encoding for
inputs as well as for outputs.
The results for 8 and 16 hidden recurrent neurons are showed in Figure 2. The
figure shows that the Extended Kalman Filter is again significantly better than the
64 Peter Trebatický

BPTT(h). Similarly the nprKF again achieves visibly better performance than the EKF.
One can also spot the fact, that the more hidden neurons, the better performance.

8 Conclusions
We described the basic principle of the Extended Kalman Filter, Unscented Kalman
Filter, the nprKF and their joint versions. The detailed description and formulas of
these filters can be found in [6].
The main contribution of this paper is the direct comparison of all the filters in
experiments, where they are used in the recurrent neural network training task for the
next symbol prediction. In the results from these experiments one can see much better
performance of the filters UKF, nprKF, UKFj and nprKFj (they all achieve comparable
results) when compared with the EKF. On the other hand the EKF filter achieves
definitely better results in comparison with the classic gradient method BPTT(h).
As far as we know, this paper describes the first application of the UKFj filter in
the context of recurrent neural network training.

Acknowledgement: This work was supported by Scientific Grant Agency of Slovak


Republic under grants #1/1047/04 and #1/0062/03, and by Science and Technology
Assistance Agency under grant APVT-20-002504. I would like to thank Ing. Michal
Čerňanský and Ing. Matej Makula for valuable advice and comments.

References
1. Čerňanský, M., Makula, M., Beňušková, Ľ.: Processing Symbolic Sequences by
Recurrent Neural Networks Trained by Kalman Filter-Based Algorithms. In:
SOFSEM 2004: Theory and Practice of Computer Science, Matfyzpress, Praha,
Vol. 2 (2004), 58 - 65
2. Haykin, S., Puskorius, G.V., Feldkamp, L.A., Patel, G.S., Becker, S., Racine, R.,
Wan, E.A., Nelson, A.T., Rowels, S.T., Ghahramani, Z., van der Merwe, R.:
Kalman Filtering and Neural Networks. John Wiley & Sons, NY, 2002.
3. Julier, S.J., Uhlmann, J.K.: A New Extension of the Kalman Filter to Nonlinear
Systems. In: Int. Symp. Aerospace/Defense Sensing, Simul. and Controls, Orlando,
FL (1997)
4. Nørgaard, M., Poulsen, N.K., Ravn, O.: Advances in Derivative-Free State
Estimation for Nonlinear Systems. Technical report, Revised edition, Technical
University of Denmark, 2000.
5. Prokhorov, D.V.: Kalman Filter Training of Neural Networks: Methodology and
Applications. In: Int. Joint Conference on Neural Networks, IJCNN2004 Tutorials,
Budapest, Hungary (2004)
6. Trebatický, P.: The Recurrent Neural Network Training with the Extended Kalman
Filter. Neural Network World. Submitted for publication.
Security,
Computer Systems
and Networks
Complexity Analysis of Routing
Algorithms in Computer Networks
Peter BARTALOS∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
peter.bartalos@stonline.sk

Abstract. There is a huge growth of the Internet users in the last


years. The network became overloaded. One of the necessary
processes in computer networks is routing, performed by various
algorithms. It became important to analyze the complexity of routing
strategies. This paper includes a complexity analysis of two routing
strategies. We have showed, that the space complexity of routing with
routing tables in network with n nodes is O(nlog∆) and the time is
O(1). The space complexity of interval routing with at most k intervals
is O(k∆logn) and the time is O(log(k∆)), where ∆ is the maximum
degree of the graph.

1 Introduction
The routing is one of the latency sources in communications network. Routing
algorithm has a task to determine the suitable port for delivering message addressed to
one network node. The aim is to have the fastest routing available in the network. The
case of every node sending the message to each other by correct delivery can be
considered as optimal one. It could be achieved by keeping a table of size O(n) by
every node, where n is the number of nodes. It is not very suitable in larger networks.
There are lots of methods which memory demand for the data holding required for
routing is very low. To ensure effective routing with the best possible throughput it is
important to identify and analyze complexity of routing strategies. In this paper we will
use the classic operators of asymptotic notation.


Supervisor: Mgr. Martin Nehéz, Institute of Informatics and Software Engineering, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 69-76.


70 Peter Bartalos

1.1 Preliminaries

Asymptotic notation (such as O, Ω , o) is used in this paper as it is usual in the


computer science, cf. [13]. As a basic computational model we assume a standard
abstract random access machine (RAM), cf. [13]. We will assume a RAM with
logarithmic cost criterion1 for analysis of space complexities and unit cost for time
complexities2. The network is modeled as a simple unoriented graph G = (V, E), where
nodes from V represent processors and edges from E are communication links. The
maximum degree of G is denoted by ∆ . For other details see [5, 13].

2 Routing tables

2.1 Informal description

The principle of routing with routing tables is straightforward. Every node keeps a
table with entries for each other node. Using these entries, it could be determined via
which outgoing port a message had to be sent.
2 4
Destination Port Destination Port
1 0 1 0
3 1 2 0
4 1 1 0 3 0
5 1 5 1

0 3 1
0 1

0 Destination Port 1 Destination Port


1 0
Destination Port 2 0
0 1 0
2 0 4 1 2 0
3 0 m 5 2 3 0
4 0 4 1
5 0
1 5

Fig. 1. Routing tables (message m destined to node 5)

Routing with routing tables is today a dominant strategy. There are lots of
methods to reduce the memory demand for the data holding required for routing. The
aggregation is one of the most important. It is based on that we don’t hold information
for each node in network but only for subnetworks to which nodes belong. This way
one can excessively reduce the size of routing tables.

1
number of bits
2
number of operations
Complexity Analysis of Routing Algorithms in Computer Networks 71

2.2 Complexity analysis

The Algorithm 1 contains a description of a routing algorithm with routing tables in


pseudocode. Recall that network is modeled by a graph G = (V, E) with maximum
degree ∆.

Algorithm 1.
The algorithm is understood for routing in node u ∈ V .
Input: destination node d, message m.
A data structure table[] is a field which implements the routing table. Its size is n and it
stores identification labels of ports which are positive integers. It is organized in such a
manner that in i-th position is stored an ID-number of port via which a message
addressed to a node w ≠ u is forwarded.

receive(m, d);
if d = = u then OK
else
p = table[d];
send(m, d) to p;

Lemma 1. To store a positive integer j it is required a register with at least


⎡log 2 j ⎤ bits.
Proof. It is possible to vary at most j = 2n values in n-bit register. Taking logarithm of
j=2n resulted in log2j = n. It means for storing the j value is an n bit register necessary.
Indeed, ⎡log 2 j ⎤ bits are necessary, since the number of bits must be an integer.

Theorem 1. Routing with routing tables requires O (n log ∆ ) bits to store the routing
information.

Proof. The size of registers in RAMs depends on the number stored in it3. We need
⎡log 2 ∆ ⎤ bits4 to keep port numbers. We need to store n such values. Hence the
memory requirements are n.⎡log 2 ∆ ⎤ = O (n log ∆ ) bits.

Using routing tables represented by data structure described in previous section


the process of finding the corresponding port is very fast. The time of executing the
algorithm doesn’t depend on network parameters. It is a constant time performance.

Theorem 2. Time complexity of Algorithm 1 in RAM model with unit cost criterion
is O(1) .

3
in difference with real computers with fixed register sizes
4
from Lemma 1.
72 Peter Bartalos

Proof. Algorithm 1 consists of 4 operations. It is necessary to carry out exactly these 4


= O (1) operations for optional input, i.e. constant amount, independent on input.

3 Interval routing

3.1 Informal description

Interval routing is a space efficient routing strategy used in computer networks. This
method gaining a great interest because of accessible implementation chips available
on the market. The basis of interval routing idea is to label all of the nodes with integer
from one set (for example {1, 2, 3,..., n}) and labeling of all arcs with interval (in range
of number of nodes). These intervals means that a message addressed to a node labeled
with u, via a port labeled with interval which includes a node u is forwarded.

2 4

[3, 5]
[1, 3]
[1]
[1, 2] 3 [4]
[5]

[5] [4]
[2, 5]

m [1, 3]

1 5

Fig. 2. Interval routing (message m destined to node 5)

Definition 1:
Interval labeling scheme (ILS) of graph G = (V, E) is a scheme, where:
1. a node labeling is an assignment of unique labels to nodes of V
2. for each node v ∈ V, an edge labeling is an assignment of disjoint intervals to
arcs e ∈ I(v), where I(v) denotes the set of arcs outgoing from v
Complexity Analysis of Routing Algorithms in Computer Networks 73

An interval routing scheme, denoted also IRS, in a graph is a valid ILS. The
validity means that the routing strategy guarantees that the message will always be
delivered to its destination using that ILS.

Proposition 1. [12] The validity of every ILS can be checked in O(n2) time, where n is
the number of nodes of the graph.

Intervals used in labeling are understood as cyclic: [a, b] = {a, a + 1,…, V , 1,


…, b} for a > b. In case of IRS using only linear interval I = [a, b], where a ≤ b, it is
called a linear (LIRS). If the labels of all outgoing arcs are grouped into at most k
intervals then the scheme is denoted as k-IRS. The memory requirements of interval
routing schemes depends also on k. The Compactness of a graph G is the smallest
integer k such that G supports k-IRS.

Proposition 2. [11] For general graphs, the problem of deciding whether G supports
1-IRS is NP-complete.

3.2 Complexity analysis

Let Ψ (u ) be the number of intervals assigned to a node u. Let Ψ denote max( Ψ (u ) )


over all nodes u ∈ V (G ) .

Lemma 2. It holds: Ψ ≤ k∆ , hence Ψ = O(k∆) .

Proof. Let us denote φi(u) the number of intervals which belongs to port i in node u.
We know that we denote every port with at most k intervals in k-IRS, so φi(u) ≤ k.

ϕ i (u) represents Ψ (u ) . Since Ψ (u ) =
∀ports

ϕ i (u ) ≤
∀ports

k = k deg(u ) ≤ k∆ for
∀ports

each node u ∈ V , hence Ψ ≤ k∆ , what implies Ψ = O(k∆) .


5

The pseudo code of a routing algorithm is as follows.

Algorithm 2:
The algorithm is understood for routing in node u ∈ V .
Input: destination node D , number of intervals in node Ψ .
Output: port number.
Other variables: index of interval I .
Algorithm uses these functions:
• int getLeftBorder(int i) returns the lower bound of interval stored
in i-th position in sequence P1 = (a1,...,aψ) of lower bounds of intervals.
5
from definition of O-notation
74 Peter Bartalos

• int divide(int R) returns ⎣R / 2⎦ for R > 1 and 1 for R equals 1.


I = ⎡Ψ / 2⎤ ; R = ⎣I / 2⎦ ;
While(1)
if(getLeftBorder( I )) <= D )
if(getLeftBorder( I + 1)) > D ) return( I );
else
I = I + R ; R = divide( R );
else
I = I - R ; R = divide( R );

Theorem 3. Provided having a graph G and let u ∈ V(G). Assume that it is possible to
create k-IRS for G. We need than O(k deg(u ) log n) bits to keep routing information
in node u. The space complexity for a whole network is O(k∆ log n) , since we can
substitute deg(u) by ∆ .

Proof. For a convenience, let us assume only a linear k-IRS. The proof for a general
(i.e. nonlinear) k-IRS can be done by a similar manner. In all nodes we will denote the
i-th interval in node [ai, bi] for i ∈ {1,..., Ψ } and the port to which this interval belongs
we will denote pi. Let us assume that intervals [ai, bi] are increasingly sorted and linear.
Recall that P1 = (a1,...,aψ) is a sequence of lower bounds of intervals and P2 = (p1,...,pψ)
is the sequence of ports such that pi is a ID-number of port via which a message
addressed to a node included in interval [ai, bi] is forwarded. Than we only need to
store these two sequences for routing. It is not necessary to keep upper bounds bi of
intervals. We can evaluate them: bi = ai+1-1 for i < Ψ and bi = n for i = Ψ . Storing the
lower bound requires O(log n) bits and the number of port O(log ∆) bits. In both
sequences we have exactly Ψ members. Totally we need Ψ.(O(log n) + O(log ∆ ))
bits. As ∆ < n, therefore also log ∆ < log n . It yields
Ψ.(O(log n) + O(log ∆)) = Ψ.O(log n) = O(Ψ log n) = O(k∆ log n) .

n
Proposition 3. [11] A more accurate coding allows us to use only O (k∆ log ) bits
k
per node.

Assume the encoding of subsection 3.2, finding the interval which belongs to the
destination node requires looking in at most Ψ intervals. Using sequential searching
the time complexity is O(Ψ ) . However P1 is sorted, we can reduced the time. We
obtain the following results.

Theorem 4. Time complexity of Algorithm 2 in RAM model with unit cost criterion is
O(log(k∆)) .
Complexity Analysis of Routing Algorithms in Computer Networks 75

Proof. It was showed in [5] that the complexity of binary searching is O (log n) for n
element list. Assuming the Algorithm 2 the resulting complexity is
O(log Ψ ) = O(log(k∆)) .

4 Conclusions
The main results of this paper are summarized in Table 1.

Tab. 1. Summary
Routing tables Interval routing
Space complexity O(n log ∆) O(k∆ log n)
Time complexity O(1) O(log(k∆))

Our results can be used mainly to estimation of latency of message passing in wide-
area networks.

References
1. Aho, A., Hopcroft, J., Ullman, J.: Design and Analysis of Computer Algorithms.
Addison-Wesley. 1974.
2. Bakker ,E. M., Leeuwen, J., Tan, R. B.: Linear Interval routing. Department of
Computer Science, Utrecht University, 1991.
3. Bartalos, P.: Complexity analysis of routing algorithms in computer networks.
Bachelor thesis (in Slovak). Faculty of Informatics and Information Technologies,
STU. December 2004.
4. Bodlaender, H. L., Leeuwen, J., Tan, R. B., Thilikos, D. M.: On Interval Routing
Schemes and Treewidth. Department of Computer Science, Utrecht University.
1996.
5. Cormen, T., Leiserson, C., Rivest, R.: Intorduction to lgorithms. MIT Press, 1990.
6. Flammini, M., Leeuwen, J., Spaccamela, A. M.: The Complexity of Interval
Routing on Random Graphs. Comput. J. 41 (1)(1998) 16-25.
7. Fraigniaud, P., Gavoille, C.: Interval routing schemes. Algorithmica 21 (1998)
155-182.
8. Gavoille, C., Nehéz, M.: Interval routing in reliability networks. Theoretical
Compurer Science. Vol. 333, No. 3, (2005) 415-432.
9. Gavoille, C., Nehéz, M.: On Interval Routing in Random Meshes. In: Proc.
Eurocomb '03 (J. Fiala ed.), ITI Charles University Prague (2003), 147-150.
10. Gavoille, C., Peleg, D.: The compactness of interval routing for almost all graphs.
SIAM J. Comput. 31 , No. 3 (2001),, 706-721.
76 Peter Bartalos

11. Gavoille, C., Peleg, D.: The compactness of interval routing. Université Bordeaux.
1999.
12. Gavoille, C.: A survey on interval routing. SIAM J. Discrete Math. 12, No. 4
(1999), 459-473.
13. Gruska, J.: Foundations of Computing. Int. Thomson Computer Press. 1997.
14. Lau, F. C. M., Tse, S. S. H.: A Lower Bound for Interval Routing in General
Networks. Networks 29 , No. 1 (1997), 49-53.
15. Lau, F. C. M., Tse, S. S. H.: On Two-label Interval Routing. Department of
Computer Science The University of Hong Kong. 1996.
16. Lau, F. C. M., Tse, S. S. H.: Two Lower Bounds for Multi-Label Interval Routing.
In: Proc. of SIROCCO '95, Carleton Scientific Press, 123-134
17. Lau, F. C. M., Tse, S. S. H.: On the Space and Traffic Problems of Interval
Routing. Department of Computer Science The University of Hong Kong. 1997.
18. Lau, F. C. M., Tse, S. S. H.: More on the Efficiency of Interval Routing.
Department of Computer Science The University of Hong Kong. 1998.
19. Nehéz, M.: On Subgraphs with Compactness 1 in Random Meshes. In: Proc. 3rd
International Conference APLIMAT 2004, Dept. of Mathematics, Faculty of
Mechanical Engineering, Slovak University of Technology, Bratislava (2004),
729-734.
20. Leeuwen, J., Tan, R. B.: Interval routing. Comput J. 30 (1987), 298-307.
Enhancing the Work and Preparation of
Instructors Teaching in Cisco Networking
Academy Program (CNAP)
Peter MESJAR∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
pmesjar@centrum.sk

Abstract. Cisco Networking Academy Program developed by Cisco


Systems, Inc. is the most widely used e-learning system nowadays.
Important educational institutions in almost every region throughout
the world participate. Educational process combines modern Internet
technologies with practical skills gained inside specialized labs
outfitted by modern equipment under the guidance of knowledgeable
instructors. However the material provided by CNAP for instructor
preparation is not optimal if CNAP is being implemented at university
level of education. Presented work deals with overcoming most of the
shortcomings original material suffers from to enhance instructor
preparation and further enhance the process of practical education of
CNAP students.

1 Introduction
Cisco Networking Academy Program was developed by Cisco Systems Inc. because of
high demand for skilled engineers knowing how to design, install operate and
troubleshoot computer networks. As the interest among students as well as educational
institutions grew so did the e-learning program evolve and continue to do so. Currently
it does not only teach various subjects relating solely to computer networks, but other
courses include programming in Java, web page design, fundamentals of computer
technology, fundamentals of UNIX operating system and numerous other courses. So
far courses are mainly computer related, however this does not mean CNAP can be


Supervisor: doc. Ing. Pavel Čičák, PhD., Institute of Computer Systems and Networks,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 77-82.


78 Peter Mesjar

implemented only for field of computer technology. CNAP is whole e-learning system
incorporating professionally developed study material accompanied by hands-on
laboratory exercises, on-line testing, CNAP users and student records tracking and
class management to name just a few of its main features. Following pictures display
some of the functionality of CNAP e-learning system [1].

Fig. 1. Instructor home page showing classes he/she is teaching.


Enhancing the Work and Preparation of Instructors Teaching in Cisco… 79

Fig. 2. Student record tracking via class grade book.

2 Instructor preparation

2.1 The structure of original practice lab material

Before I explain the problems current study material is facing, I will introduce the
structure how practical laboratory exercises are presented to the students as well as
instructors. However it needs to be pointed out that my work deals solely with
shortcomings of practical laboratory exercises and has nothing to do with potential
problems of study texts, where the theory is explained that need to be read before
moving to practice in labs.
The usual structure followed by all laboratory exercises presented by original
CNAP material is as follows. Every laboratory exercise begins with a sample picture
(figure 3, [1]) showing how the equipment students and instructors will be practicing
on needs to be connected together.
80 Peter Mesjar

Fig. 3. Sample picture of network diagram.

The text following the picture is divided into step by step instructions. Each step
instructs students in detail what they need to accomplish and what to configure on their
lab equipment. Additionally there are numerous questions aimed to reinforce students’
knowledge on the subject. Sample step by step lab structure is displayed on figure 4
(sample laboratory exercise is from [1]).

Fig. 4. Sample step by step lab structure.


Enhancing the Work and Preparation of Instructors Teaching in Cisco… 81

2.2 Original practice lab shortcomings and proposed solutions

First problem can be identified under the closer inspection of lab setups described by
pictures like the one on figure 3. The problem lies in their simplicity. Most of the
computer networks are large and while teaching students and preparing instructors on
such simple scenarios is sufficient at beginner level of education, it is not adequate and
sufficient as students and instructors progress with their studies. Also explaining of
how more advanced and complex routing protocols and other techniques used in
modern computer networks work on simple lab setups is missing the desired effect.
Additional problem with such simple scenarios is that they are lab scenarios and are
not even trying to simulate real life networks and real life problems.
Further inspection of the structure of original material yields to another problem.
Laboratory exercise is divided into step by step instructions. Each step incorporates
what are students expected to do with their laboratory equipment, how to accomplish
the goal and series of questions to reinforce student knowledge of the subject. The
problem with original study material lies in the method of “how to accomplish the
goal” is presented to students. The “how to” is written in such detailed way that all the
student is required to do during laboratory work is to copy the directions directly from
the lab material and without even understanding what he is doing his lab will work
almost flawlessly. Presenting the labs written in this way imply additional problems.
Student does not need to prepare himself by reading study texts before coming to the
lab for practice. He does not even need to understand what is happening and the labs
will just work.
Last problem lies in the form of questions included with laboratory exercise. Most
of the time they are just plain simple like “copy this number from the output of this
command”. Other questions are just asking for wrong or completely non-important
information, which may sometime even confuse students.
The proposed solution to all shortcomings original material is facing is to
completely rewrite original material and adapt all laboratory exercises to the
environment where the teaching takes place.
Lab setups described by accompanying pictures should be made more complex,
including more equipment and trying to simulate more real life situations.
The “how to” method of solving the lab exercise original material presents is the
main concern here. At least this part needs to be rewritten or the lab exercises will be
nothing more than directions that if followed everything will work without even
understanding the underlying processes. Proposed solution here is to create step by step
instructions in such way the students will be required to figure out how to make the lab
work from what they have learned by reading the study text and/or by consulting the
instructor during the lab.
The problem of questions can be solved by class discussion. Here the instructor
role is very important. By asking the right questions student knowledge on the lab
subject together with underlying theory will be reinforced. Most important part in
solving this problem is well-prepared and knowledgeable instructor.
82 Peter Mesjar

3 Conclusions
Rewriting the labs so they are adapted to the environment where the instructor is
teaching will greatly help the instructor to understand every aspect of practical
scenarios presented to students during lab work. Since I am also an instructor of CNAP
I can say from my own experience this helped me to understand computer networking
theory much better, helped me to know every way in which the equipment used during
the lab can go wrong. I can react to student or other instructor questions much faster
and I can answer more and more of their questions without further consulting
additional material.
Rewriting the original materials to adapt to our teaching environment not only
helped me but also the students I am teaching. They are getting better grades in online
testing, better understand the theory they study and better react to real life problems
posed to them by everyday life at work or at school.

References
1. CCNA practical laboratory exercises. http://cisco.netacad.net
Methods for Improving Security
of GNU/Linux System
Tomáš ZAŤKO∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
woody@ynet.sk

Abstract. We describe security-improving features, which are usually


not incorporated into common Linux distributions. Although the work
is primarily focused at the GNU/Linux operating system, principles
used here are also applicable to other (mainly UNIX-like) operating
systems. The work aims on recommended changes to standard
systems: Use of dynamic firewall, installation of special logging
server, description of encrypted file system capabilities, kernel
security extensions, access control system, and intrusion detection
system.
Abstrakt. Článok opisuje možnosti zvýšenia bezpečnosti, ktoré
nebývajú štandardnou súčasťou väčšiny linuxových distribúcií. Aj
keď je práca primárne zameraná na operačný systém GNU/Linux,
princípy sú aplikovateľné aj na iné operačné systémy, hlavne však na
systémy unixového typu. Práca sa v niekoľkých bodoch zameriava na
odporúčané zmeny oproti štandardným systémom: použitie
dynamického firewallu, zavedenie špeciálneho logovacieho serveru,
popis možností šifrovaných súborových systémov, bezpečnostných
rozšírení jadra systému, systému kontroly prístupu, systému detekcie
prieniku. Popisované zmeny boli zrealizované a testované na dvoch
systémoch. Bolo zaznamenaných niekoľko pokusov prístupu k cudzím
údajom. Na štandardnom systéme by nebolo možné tieto pokusy
zaznamenať. Bolo zachytených aj niekoľko vzdialených pokusov o
prienik, ktoré boli znemožnené zásahom dynamického firewallu.
Bežní používatelia pracujúci na takto upravenom systéme
nespozorovali žiadne obmedzenia, ktoré by im prekážali v práci.
Ukázalo sa, že takýto systém môže fungovať bez ďalších negatívnych
dopadov na funkcionalitu sytému.


Supervisor: Ing. Branislav Steinmüller, Institute of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, p. 83.


Computer Networks and Remote Control
Michal KUBÍK∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
kubik_michal@pobox.sk

Abstract. This contribution deals with possibility of using computer


networks in automation for remote control and brings design of
possible solution for remote control calibration workplace that is used
for calibration of digital electricity meters. In the first part the
differences between local and remote control are explained. The
possibility of using various network protocols, which can be used in
automation (TCP, HTTP, FTP, SMTP, RDP) is analyzed too. It is
important to discern between remote control inside and outside of
LAN and related security.

1 Introduction
The requirement of quality increase, sharing resources or cost saving, which cause, that
control technique is still more and more including information systems, is necessary.
Usually, the first step is virtual equipment or whole virtual laboratories, which
purpose is control process simulation. In the next step virtual equipments are
substituted with real equipments and control process are made inside laboratories. This
step is kind of preparation for employment control process in real control applications.
Computer networks are relatively new part of control technique. They offer
possibility of remote control. For operator this fact allows to move away from control
process or even to become a mobile and control process from almost any place of the
world.


Supervisor: Ing. Čičáková Oľga, Department of Measurement, Faculty of Electrical
Engineering and Information Technology, doc. Ing. Kotočová Margaréta, Institute of
Computer Systems and Networks, Faculty of Informatics and Information Technologies STU
in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 84-89.


Computer Networks and Remote Control 85

2 Control possibility
In present time it is possible to control process in local or remote mode so these two
terms should be explained.
Local mode control is the form of control, where the signals are transported by
electric conductor, RS234, GPIB, VXI, PROFIBUS etc. Individual parts of working
place can be interconnected with each other or with control computer. The control
computer controls whole working place [fig. 1]. In this case control computer is only
control element in entire system. Very often, in local mode control, all parts of control
system are placed near each other.

equipment Control computer


GPIB,VXI

equipment

Fig.1. Local control.

Remote mode control. Control is becoming remote if a network and next one or
more computers are connected to the local control system. After that control computer
is called “local client” and other computers are called “remote clients”. One of the
remote clients can control process. In this case this remote client is called “control
client” [fig. 2]. Some present control equipments have RJ45 interface and can be
connected directly to network.
remote client
local client
network

control client

equipment GPIB,VXI equipment

Fig.2. Remote control.

Tab.1. Remote control advantage and disadvantage comparison.


Positives of remote mode control Negatives of remote mode control
Sharing expensive equipments High attack risk
Real time presentation of control process Access to computer network
Possibility to participate on control process Higher primary investment
from any place of the world
86 Michal Kubík

3 Control process and network protocols


Often requirement in industry is to make real time control or control with at least
certain define delay. Although this requirement can not be fulfilled by Internet,
network protocols penetrate to this area. The most widely used protocol is TCP. It
creates a base for higher application protocols e.g. HTTP, SMTP, FTP
HTTP is protocol for transporting web pages. HTTP server can be used for actual
values presentation of state values on web pages. For user the advantage of HTTP
protocol is in the same way of work as with Internet [2].
SMTP is the most often used protocol for e-mail transport. Besides that, it can be
used for states transport occurred during control process. Present PLC’s contain SMTP
client for delivering data directly to the data part of PLC or in opposite direction from
PLC’s to operator.
FTP protocol is suitable for transporting a big amount of data. For this reason it
can be used for technologic process transport.

Remote Desktop is next solution for extension of local mode control to remote
mode control without any changes made in existing software. With the Remote
Desktop your computer can be remotely controlled from another place. It is allowed to
use the data, applications, and network resources that are on local client, without being
in the same room [4].

4 Existing solutions
Control system development is complicated and expensive work. Companies
developing control systems deliver remote control possibility as a small part of whole
system. The most widely used products are SIMATIC, Matlab, DataSocket [3].
Existing solution advantage are easy implementation and support. On the other side
disadvantage are higher price and more complicated scalability.

5 Design
The system was split into tree mutually communicate parts: local client, remote client
and server. TCP is used as a network protocol.

5.1 Local client

In the present time local client is the system for local control workplace for calibration
of digital electricity meters [1].
Local client functions:
• receiving of commands from the server and their transformation to suitable
format for the connected equipment
Computer Networks and Remote Control 87

• transformation of data received from equipment to right format suitable for


the server and subsequently, sending of transformed data to the server
• update of list of ports and connected equipments.

5.2 Remote client

Remote client allows remote control workplace. It is necessary to ensure mutual


exclusion algorithm for exclusive workplace control, if more remote clients are
connected to server at one. The control client is remote client which has got permission
to control process. The other clients are called passive clients. They can only watch
control process between local client and control client in passive mode.
Remote client functions:
• remote client authentication on the server before control process
• connection to the local client over the server if it’s possible (no other control
client)
• sending and receiving of commands from local client over server
• preparing of list of commands in the case of batch processing
• update of list of ports and connected equipments
• logout at the end of control process.
It is necessary to have an operator for preparation and configuration workplace
before calibration.

5.3 Server

This part is separated because of the security and better user management.
Server functions:
• remote client’s identification and authentication
• ensure mutual exclusion for remote clients
• data distribution from the control client to the local client
• distribution of respond from local client to all remote clients
• update of list of clients and their activity.
88 Michal Kubík

5.4 Data format

As it was mentioned above one of the tasks for local client is data transform from
control client to the right equipment and back. Present workplace contains equipments
with different data format. The general data format to abstract from equipment type
was designed.
General data format
TYPE PRIORITY ADDRESS DATA EXTENSION

TYPE - data type in field DATA (COMMAND, RESPOND, ERROR,


LOGIN, LOGOUT).
PRIORITY - message type priority
ADDRESS - equipment address. This field is used if field TYPE contains
data (COMMAND, RESPOND, and ERROR)
DATA - this content field depends on field TYPE (see part
COMMAND data type and RESPOND data type)
EXTENSIONS - not used in present

a) COMMAND data type. This message is from control client to local client sent.
COMMAND PARAMETERS DURATION TTSC

COMMAND - command code


PARAMETERS - command parameters
DURATION - command time duration
TTSC - time to send command. How many time will be command
sent.

b) RESPOND data type. This message is from local client to remote clients sent.
ICOMMAND RESPOND

ICOMMAND - (input command) original command for which is respond sent.


Fields COMMAND, PARAMETERS and DURATION
contain.
RESPOND - respond to command from equipment

There are two reasons why original message is sent in RESPOND message
1. Respond from local client is to all remote clients routed. In this message has
to be information to which command respond comes.
2. Remote client can in batch mode work and so sent batch of commands sent.
Responds one by one with a delay comes and if field PRIORITY is used, then
also in different order. In this case all remote clients would have to keep list of
commands for which respond wait.
This solution disadvantage is that respond can be shorter than command often.
Computer Networks and Remote Control 89

5.5 Remote control over Internet

It is assumed, that local client and server will be placed inside of the LAN. Remote
clients will be connected from outside of the LAN [fig. 3.]. For remote clients access to
LAN is established by VPN. Connection security is made by IPSec on network layer.
IPsec works in tunnel mode. Security is the priority of connection so ESP protocol is
used.
passive client
server Tunnel
local client

Tunnel control client

GPIB,VXI

Internet
equipment LAN

Fig. 3. Remote control over Internet.

6 Conclusions
This article shortly describes possible remote control process solution and briefly
existing commercial solutions in this field. Design describes remote control calibration
workplace which is used for calibration of digital electricity meters inside of LAN. It is
assumed that the ports for TCP protocol are permitted and access to the LAN will be
able only for authorized users. There is also short design of remote control over
Internet. In the future the implementation of remote control over LAN should be made,
design for remote control over Internet should be finished and implemented.

References
1. Skladan, B.: Programové vybavenie pre kalibračné pracovisko s EKS 05-3.
Bachelor final project, Bratislava, 2004.
2. Halva, T.: Internetové procesy usnadňují řízení procesů na dálku. Automa, Vol.10,
No.4 (2004), 6-7.
3. Integrating the Internet into Your Measurement System. DataSocket Technical
Overview.
4. http://www.microsoft.com/slovakia/windows/xp/pro/evaluation/overviews/remotea
ccess.asp, 22.03.2005.
Network Communication Simulator
Tomáš BACKO, Juraj BUNO, Jozef BURÁK, Daniel KATANA,
Marek KOPRLA, Peter PULLMAN ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
juing@post.sk

Abstract. The objective of this work is to introduce the software


application “Network Communication Simulator“, which allows
interactive construction of optional computer network topology based
on Ethernet standard. The topology consists of routers, switches, hubs,
servers and host computers. All the devices can be configured using a
virtual text console based on the CISCO CLI and the Windows
system. The simulated communication consists of protocols IP, ICMP,
Ethernet, TCP, UDP, RIP, STP, DNS, HTTP, FTP and DHCP. There
are virtual programs PING and TRACE ROUTE which may be used
to test your network topology. Application provides statistic and
function information collection about the activities of the used
components, even in chronological order by occurrence. The
application is designed and implemented on the basis of the modeling
and simulation of discrete systems. The Tiny simulation library was
used for this purpose. The application character is pedagogical.

1 Introduction
Because the present day shows us great boom of computer networks, and not only in
big corporations, but in small firms and households as well, the demand for knowledge
from this area is great and eminent.
The purpose of this project is to allow the user to understand the functionality of a
computer network, and it is possible for to design the whole network and set it into
correct activity. At the same time the user can observe, what is going on inside the
network and this way understand the logic of network communication.
Nowadays, various tools exist, which in some way simulate a computer network
and allow its configuration. But those products cover mostly only specific areas of the
whole problematic. There are simulators for the router console to simulate CLI,


Supervisor: Ing. Katarína Jelemenská, PhD., Institute of Computer Systems and Networks,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 90-95


Network Communication Simulator 91

simulators for the configuration of pre-design network topologies, simulator creating


topologies and configuring them through dialogs and simplified testing of connectivity
of ending devices. Our goal was do create a complex application, which copies the
reality of a computer network in the best way into a virtual representation.

2 Analysis and requirements


Initial terms for the proposed model:
• topology definition of the simulated network
• simulation of different devices (like switch, router, etc.)
• simulation of communication between the devices
For the purpose of finding out new terms as well as extending the existing ones,
we made an analysis of the existing simulators. From the limitations of those
applications new terms have arisen. Those new terms are obvious from the following
text and won't be introduced by the reason of limited space.

3 Simulation model
The following subsections describe the model of a real computer network environment
from the view of the simulation process. Model of the simulation is a part of the
application.

3.1 Simulation properties

The goal, pursued already from the specification, was to sustain the chronology of
stochastic events in the simulation, which appear in the real world of computer
network. Because of this the system was understood and designed as a queuing system.
By stochastic events we mean the behavior of virtual users or the impact of outside
factors as well.
The simulation is based on cooperative threads (farther processes), which interact
using simulation time and buffer memories of FIFO type. These resources are
implemented using Tiny library, which was designed to simulate discrete systems
based on events. Itc was implemented at KIVT FEI STU, Bratislava in the year 1996
and is not the subject of this work.
The library is not designed for continual simulation requested by the application.
If no more events are scheduled, the simulation ends. The solution of this problem lies
in creating a process, which schedules itself and doesn't perform any other activity
connected to the simulation. This process serves for indicating the simulation time to
the user and dynamic adding and canceling of network components while the
simulation is running. But consequently, the problem how to correctly end the
simulation arose (e.g. when application is exiting). It was solved by making each
process determine if the simulation should not be terminated. If so the process does not
schedule any more processes. It is obvious, that the termination can take some time
depending on the size of topology.
92 Tomáš Backo, Juraj Buno, et. al.

For the simulation to have some value for the user, it must run conformly with the
real time. That means it has to be artificially slowed down so that the simulated time
would be associated with the real time. This was achieved by sleeping the simulation
thread between two scheduled events for a time, which segregates those events. This
concept solved some further limitations of the library, including the interaction with
the user. It is obvious that the real delay is strongly dependent of computers free
resources. We don't find this fact to be too serious.
The behavior of individual components of the network, e.g. switches or routers, is
deterministic and can be described by an algorithm. Their behavior will be controlled
only by external parameters entered by user. The model and the way it works is
described in further chapters.

3.2 Host

As shown on figure 1, the host computer consist of processes (cooperating threads),


whose purpose is clear. It must be said, that on the application layer, not all the
processes must be present (virtual applications).

Link layer Network layer Transport layer Application layer Applications

HOST CPU
DHCP server
(facility)
DHCP service
ARP DHCP client
cache
UDP service
DNS server
DNS service
DNS client

ethernet
interface WEB server
IP service
process HTTP service
WEB client
TCP service
FTP server
FTP service
port FTP client
connection
{MAC, IP, mask}
PING proces s
ICMP service
console TRACERT
proces s

Fig. 1. Host structure.


Network Communication Simulator 93

3.3 Router

In the figure 2, the router structure is shown. Here, it must be stated, that the
implementation of parts identical with the host computer do not have to be the same.
The number of interfaces is always greater then 1.
Link layer Network layer Transport layer Application layer Applications

port
ROUTER
ethernet ICMP service
{MAC, IP, interface PING proces s
connection mask} process
TRACERT
proces s

ARP IP service UDP service RIP service


cache

port ethernet
{MAC, IP, interface routing CPU
connection table CLI console
mask} process (facility)

Fig. 2. Router structure.

3.4 Switch

Implementation of the switch (figure 3) is different from the previous cases, especially
in its interfaces, there is no ARP protocol used. This is applied on the higher layer,
since the switch has the same MAC and IP on each port.
Link layer Network layer Applications

SWITCH
port ethernet STP service
{MAC, IP, interface PING process
connection mask} proces s ICMP service
TRACERT
process

switching switching
IP service
table process

CPU
(facility)
ARP
cache
port ethernet
{MAC, IP, interface
connection CLI console
mask} proces s

Fig. 3. Switch structure.


94 Tomáš Backo, Juraj Buno, et. al.

3.5 Link

Link presents a duplex Ethernet connection between two network components.


Parameters of the link are speed and bit error rate. Because the directions of
transmission are mutually independent, the link consists of two processes (one for each
direction). So it is simulated as on active component from the simulation point of view.
The task of each process of a link is to catch the frame from the output ports of
connected devices and in a time which depends on their length and set transfer speed
write them to the input ports of the devices on the other side.

4 Implementation
The application is implemented using object oriented approach in C++ in Microsoft
Visual Studio .NET, Microsoft Visual SourceSafe to control the versions.
Program consists of a simulation thread and the user interface thread. Each
process consists of an infinite loop, in buffers the process function is executed, and
input (output) FIFO.
The process picks up so-called transactions (packets or requests) from its input
buffer, processes them, identifies target process and writes them to input of another
processes. But if those are passive (not scheduled) it must schedule their start in time 0.
The specific of some protocols are the timers. Those are mostly solved as single
processes working with of executive processes to which they belong.
In reality, IP and higher layers are implemented by operating system. In order to
obtain representative times, the simulated device must occupy one single virtual
processor (or all the processes would be executed simultaneously). This process is
implemented as an independent process with one input buffer and one servicing
facility. If a process is active, it inserts the task into this buffer and gets to passive
status. It will be awoken by virtual processor process. To avoid being awoken by other
process (using the above scenario) it must set an added state, which informs, that the
process awaits for the end of task processing (it is passive from the side of the
simulation).

5 Achieved results
The basic network components can be added into the network, they can be connected
optionally even during the simulation (mentioned interaction of the simulation with the
user). The created topology can be saved into a file, and loaded back at any time. The
configuration of all network components is saved as well. All of this by using user
friendly graphic user interface.
Topology can be tested using the program PING or TRACE ROUTE, further,
TCP connections can be established using HTTP or FTP protocol. Every host computer
can be configured (IP address, running application services, etc.) using a dialog
window. Routers and switches are configured by a CLI console, which simulates the
behavior of original devices very realistically.
For each component of the network, the statistic information, like number and
types of received and sent packets or processor usage of the device, can be shown in
Network Communication Simulator 95

the application window. It is also possible to generate load between the elements of the
topology and simulate the error rate of the link. Information about what which
component of the network executed are shown as well, where the level of details can
be configured and information can be filtered. The printout of every component is
differenced by color.

6 Conclusions
The main goal of this work was to create a software tool, using which, the user can
create and test his own virtual computer network. Tiny library has permitted us to
approach very closely to a real network behavior. It means that the communication in
each node copies the communication model TCP/IP, which designates this application
for more development and implementation of simulated protocols. The modular object
oriented architecture of the program helps this as well. This model allowed us to create
a whole package of protocols and tools, giving the user the option to test the network
not only based on the availability of individual nodes, but from the print of view of
their usage as well.
Another advantage of the software is its usability in the pedagogical process.
Students can gain experiences not only by functional testing of created topologies, but
by configuring them and testing them as well.
We encountered many difficulties when developing this tool. We managed to
overcome them only by the successful cooperation of the team members and thank to
the support and consultations with Ing. Solčány and the project leader Dr. Jelemenská.

References
1. Dostálek, L., Kabelová, A.: Velký průvodce protokoly TCP/IP a systémem DNS.
2nd release Praha: Computer Press, 2000. 426 p. ISBN 80-7226-323-4.
2. Hedrick, C.: Routing Information Protocol. Rutgers University. 1988, RFC1058,
33 p.
3. IEEE 802.1D: Media Access Control Bridges PART 3. IEEE. 1998, 373 p.
Security Mechanisms in Grid
Environments
Adrian BAGALA, Roland BOTT ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovak Republic
{bagala,bott}@fiit.stuba.sk

Abstract. This document describes security technologies and


mechanisms used in grid environments. The Grid Security
Infrastructure – GSI, which is implemented in the Globus Toolkit as
well, is described in detail. The main focus is on methods of
identification, authentication and authorization, based on X.509
certificates and SSL/TLS protocols. Finally a solution of community-
based access control over the grid resources is presented, which is
interpreted on the implementation of the Globus Toolkit.

1 Introduction
Computational grid is a technology allowing IT resources of various organizations,
institutions or individuals to be commonly used, creating one unified structure. It is
used mainly for complicated and time consuming computation tasks. These
computations run within the environment mentioned above are known as grid
computing.
The infrastructure appears for the user as a single powerful computational system.
So the grid is an abstraction allowing transparent and easy access to distributed
computational resources. It consists of a number of interconnected resources like
computational systems, data storages and the connections between these systems. The
entities of this structure could be geographically spread and the interconnections are
provided by network infrastructures.
The required features of the grid are security, reliability, effectiveness, low price
and high throughput for computational applications. This article is focused mainly on
the current most used security technologies implemented in the most grid environments


Supervisor: doc. Ing. Ladislav Hudec, PhD., Institute of Computer Systems and Networks,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 96-102.


Security Mechanisms in Grid Environments 97

such as the well known Globus Toolkit. The security is mainly focused on the
identification, authentication and authorization of the grid users. These security
technologies are similarly used in community solutions of individual access as well.

2 Grid Security Infrastructure (GSI)


The Grid Security Infrastructure was implemented as a component of the Globus
Toolkit, providing security mechanisms. GSI complies with the Generic Security
Service Application Programming Interface (GSS-API, RFC 2078/2743) standard. The
implementation uses X.509 certificates and OpenSSL libraries [2].
The basic requirements on GSI are [2] [1]:
• Every entity or subject accessing grid resources (user, device, resource,
process or application) must have its unique identity. The identity of the
subject could be represented using certificates. These certificates are issued by
a trusted Certification Authority (CA). Globus Toolkit uses X.509v3
certificates.
• The identity of a subject needs to be ensured or authenticated. This is
provided by the TLS authentication protocol (descendant of the SSLv3
protocol). The identification information is guaranteed with the trust in CA
and its signature policy.
• The subject should be allowed to run processes on remote resources as well,
which are also part of the grid and to which the subject has been granted
access. The entity which acts behalf of a user on a remote resource is called
proxy. Globus generates a proxy with new own certificate valid only for
limited time, signed by the user’s certificate. The remote device could verify
the proxy certificate by the user’s signature, which is in turn verified by the
Certification Authority’s signature trusted by the remote device. This way the
remote device also authenticated the user standing behind the proxy
certificate.
• In a grid, there could be a number of processes created for the computation,
which could demand access on remote resources. For these processes
belonging to one user, series of proxy certificates are created, which make
possible for them to identify and authenticate themselves.
• Every resource is able to determine (authorize) if it can accept a particular
incoming request, based on Access Control Lists (ACL).
• As the last step to the authorized usage of a resource after authentication is
mapping the global identifier or name of a user to local. The global name is
based on the subject of the proxy certificate in the format of X.500
Distinguished Name (DN). The grid resources have public gridmaps, which
contains the mappings between DNs and local usernames. This method
assures that the requester gets all relevant user rights.
98 Adrian Bagala, Roland Bott

2.1 X.509 Certificates

GSI uses for authentication purposes certificates of public keys X.509 and SSL. These
certificates assign to grid subjects or entities unambiguous names and are signed by
Certification Authority [5].
The format of the certificate used in the Internet is described in RFC-3280 [6].
The certificate consists of the following basic parts:
• number and version of the certificate
• name and ID of the subject and the issuer
• public key of the subject
• the validity period of the certificate
• extensions of the certificate
• the identifier of the signing algorithm
• digital signature of the CA

2.2 X.509 Proxy certificates

The proxy certificate is based on the X.509 certificate. It was set up to help perform a
job process on a remote resource, to which a user has been granted access within the
grid. For numerous processes a chain of short-term proxy certificates is created, also
known as user proxy. Processes, belonging to one user but running on various remote
resources, using these proxy certificates authenticates themselves without the need of
an interactive user authentication. The certificate is signed by the user itself or by one
of the user proxies. The process of remote proxy creation is called delegation, where a
new private key is created along with the certificate of the corresponding public key,
which is signed by the key from the creator’s X.509 certificate.

2.3 Single Sign-On

The user’s private key with long-term access rights attached is protected using various
methods, which needs manual authentication. This process is needed to protect the
private key. But this could be graceless when the user needs to access the key all the
time, using it for authentication on remote resources [4].
The proxy certificate is addressing this problem, enabling sign-on. It makes
possible for the user to authenticate manually only once at the proxy certificate
creation. This proxy certificate could be used repeatedly for further authentication for a
limited time period.
The creation process of the simple sign-on proxy certificate is illustrated on the
following figure.
Security Mechanisms in Grid Environments 99

Fig. 1. Creation of a proxy certificate for single sign-on

Steps of creating a proxy certificate:


1. A new key pair which consists of a public and a private key is generated to be
used in the proxy certificate. The public key is encoded in the certificate
request for further processing.
2. Using the private key of the user associated with his long-term public key
from his certificate the proxy certificate is signed, containing the public key
from the newly generated key pair.
3. The proxy certificate and the associated private key are stored in a file. This
file is protected only by the local file system.
When the proxy certificate expires, this process is repeated and the user generates
a new key pair and a new proxy certificate.

2.4 Delegating through network

Proxy certificates among others could be created for delegating owner permissions for
remote resources. This delegation is done using network connections. Therefore the
delegation process requires the network connection to be secured against attackers [4].
100 Adrian Bagala, Roland Bott

Fig. 2. Delegation of a proxy certificate over a secured network connection

The figure above shows the steps of the proxy certificate created privileges
delegation using network connection:
1. At the beginning host “A” on the left side is contacting the destination service
“B” on the right. The initiator and the destination service are authenticating
each other. The initiator uses for the authentication its existing proxy
certificate and the destination service uses its certificate with its public key.
After the authentication a secure connection is created, for example using the
SSL/TLS protocol.
2. The initiator sends its delegation request for a particular application and the
destination service generates a new key pair.
3. A certification request is signed using the new public key and sent back to the
initiator using the secured connection.
4. The initiator uses the private key associated with its proxy certificate to sign
the certification request. It generates a new proxy certificate including the
newly generated public key from the destination service and fills in the
relevant fields in the new proxy certificate.
5. The new proxy certificate is sent back to the destination service using the
secure connection. The destination service saves it to a file with the generated
private key. This new proxy certificate could be used on the destination
service by the user’s applications.

3 Community Authorization Service (CAS)


Community Authorization Service is a new component in the Globus Toolkit version
3.2 [6]. CAS makes possible to resource providers to create identical access policy for
every member of a community or group of users [3].
Security Mechanisms in Grid Environments 101

The CAS service enables group-based processing of access rights for members of
a particular community. This needs CAS server to be created, which serves as a
processor for request from community members to access provided computational
resources. Using such CAS server the resource providers can define access policy for a
particular community.
Every community of grid users initializes their own CAS server. The
representative of the community gains GSI authorization to represent the community as
a whole and deploys CAS server, which uses the community identity.
The resource providers assign access rights to a particular community of grid
users, instead of each user independently. Every resource provider ensures or
authorizes, that the holder of the community permission is representing that particular
community and if the community policy is consistent with the resource provider’s
policy.
The representatives of a community are using CAS for managing and controlling
trust relationships (for example to register users and resource providers with a
community using a community standard) and creating fine-grained resource access
control. Community members with the appropriate right could authorize other
members of the community.
When the grid user wants to access a grid resource which is accessible trough a
CAS server, the user creates a request to the CAS server. If the CAS database on the
server indicates that the user has the required rights, then it issues a limited GSI proxy
certificate for the user. This proxy certificate has an access policy attached, which
grants to the user rights to fulfill the requested action.

Fig. 3. Community based access control to resources


102 Adrian Bagala, Roland Bott

The user in turn uses the certificate from the CAS server which grants community
access rights to contact resources involving grid tools (for example GridFTP). The grid
resource then applies its local security policy to determine the access level assigned to
the community and other restrictions which are based on the security policy in the CAS
certificate.

4 Conclusions
The presented security techniques are making an essential part for the future of the ever
growing grid computing technology. Also while delegated proxy certificates and
community authorization successfully challenges some of the grid security problems,
these techniques are not fully completed yet and there is further work needed to
challenge all security issues specific for grid computing.

Acknowledgement: This work was supported by Slovak Science Grant Agency grant
No. VG 1/0157/03 entitled Methods and tools for development of the secure networked
and distributed mobile computer systems and their management II.

References
1. Foster, I., Kesselman, C., Tsudik, G. et al.: A Security Architecture for
Computational Grid. In: 5th Conference on Computer & Communications Security,
San Francisco, CA, USA, ACM (1998)
2. Gombás, G.: Globus toolkit. 2005.
http://www.lpds.sztaki.hu/projects/completed/ni2000/globus_toolkit.pdf
3. Schmidt, J.: Adatintenzív alkalmazások grid-es kornyezetben. 2005.
http://aszt.inf.elte.hu/~grid/sclust/SchmidtJanos-dipl.pdf
4. Welch, V., Foster, I., Kesselman, C. et al.: X.509 Proxy Certificates for Dynamic
Delegation. In: 3rd Annual PKI R&D Workshop (2004)
5. Welch, V., Siebenlist, F., Foster, I. et al.: Security for Grid Services. In: 12th IEEE
Int. Symposium on High Performance Distributed Computing (HPDC’03), IEEE
(2003)
6. Community Authorization Service.
http://www-unix.globus.org/toolkit/docs/3.2/cas/index.html
7. Housley, R. et al.: Internet X.509 Public Key Infrastructure - Certificate and
Certificate Revocation List (CRL) Profile. 2005. http://www.ietf.org/rfc/rfc3280.txt
Home Agent-Based Decentralized
User-Mobility with EPA-Selection
Hossam el-ddin MOSTAFA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
eng_hosam@fiit.stuba.sk

Abstract. With the explosion of Laptop industry, location will no


longer be able to influence our frequency of communication and
users became more reliant on mobility. This need for mobility has
driven companies and industry forums to spend millions of dollars on
the research and development (R&D) of wireless protocols to create a
seamless connection through home subnet, which is affordable to
mobile-IP standards. Therefore, dynamic macro user-mobility is to the
centric of all aspects in this work. Our goal is to address a
fundamental question of the appropriate level of effectively for a
home agent-based decentralized user-mobility using an EPA-
selection, and rather to understand the impact of this scheme and
MRM algorithms, on the QoS of the system for different network
parameters. Also, initial results, primary business issues, key
innovations, and the expected impact on the commercial aspects are
described.

1 Introduction
People want to be selectively communicated-anytime and anywhere via any device.
One of the most recent attractive broadband communication networks is wireless
mobile-IP (MIP) [1], in which when a user with Laptop or portal is decentralized
away from it’s home subnet (HS) (macro user-mobility), in contrast to the nomadic
user-mobility, it wants to find agents so it does not lose access to the Internet. This
access is needed for uninterrupted access to personal data (web-browsing, email, ftp,
multimedia streaming....), as well heightened demand for secure services. See Fig. 1
for a complete scenario of MIP operation.


Supervisor: doc. Ing. Pavel Čičák, PhD., Institute of Computer Systems and Networks,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 103-107.


104 Hossam el-ddin Mostafa

A key objective in providing decentralized mobility support between subnets is to


detect the mobile node (MN)’s change of location, to perform handover as the MN
moves to a new subnet, to register the MN with a foreign agent (FA) and finally to
register this new location with the home agent (HA) [2-4]. That is exactly what
mobility resource management (MRM) procedure was defined to be, and in which is
our problem.

Fig. 1. MIP scenario

1.1 Foreign agent-based decentralization

However, the reallocating process causes the end-to-end connection to be interrupted


[5] and has not got to be reestablished again until the registration is successfully
performed with the new subnet.
• Actually, all of the previous works, ex. [6], considered the registration with
the foreign subnet (FS) to be performed by the FA (FA-based), on behalf of
the MN, after moving into the FS.
• Furthermore, the registration request must first be routed from FA to HA
while both of MN and FA are in the same subnet, FS, but not in HS (i.e., they
have to ask for a permission from the HA, which either accepts or denies).
• A single MN is not a robust architecture, as it constitutes a single point of
failure, but this failure is accumulated through each movement, to next FSs.
Home Agent-Based Decentralized User-Mobility with EPA-Selection 105

• When there are a lot of MNs roam in the network, then the problem is further
accumulated.
Ideally, this interruption of connection should not be neglected but should be
further avoided, to bridge the gap between subnets, an area that until now has been
largely neglected. Even with route optimization [1], [7], the interruption problem still
remains unsolved and MIP doesn’t seem to have a complete enhanced operation.

2 Home agent-based decentralization for MRM


As we could see, interruption is based on the aspect of MIP-registration. The
registration, one of the three core capabilities [2-4] of the basic MIP protocol, may be
inefficient, since all the registration steps take place while the MN already moved into
the destined FS with no forwarding service yet and just waiting until performing a
successful registration. Therefore, the registration request experience unnecessary
delay in initiating forwarding service and in turn causes access interruption.
• A more efficient approach would be to initiate the registration with the FA
within the HS, before a change in subnet connectivity is detected.
• That is, the nearest HA (i.e. HA-based) performs the choosing process of a
FA, on behalf of the MN, according to an equilibrium policy, directly from its
updated mobility binding cache (MBC) entry.
• These steps take place while the MN still in the way to the FS, without any
loss of time.
The scheme requires only minimal changes to nodes S/W. Consequently, servers’
providers will practicalize it as a new update-function or routine in the initial
configuration of the basic MIP protocol, to be pre-defined for all nodes. Such
management, if properly engineered via modern vendors components, can provide
improved quality of service (QoS).

3 HA-based decentralization with EPA-selection


Employing the EPA concept [8], on our HA-based network, so that the discipline of
selecting (DoS) the FA is approached as follows: the agents allover the whole network
are logically ordered in the MBC according to their activity in each state and the FA is
selected to be the first ordered agent from the available ones, only in the intended FS in
which the MN will move into. Consequently, the MBC allover the network nodes
should be reconfigured.

4 Performance analysis
Applying the EPA principle, in which it is assumed that the system is always at an
equilibrium point of the Markov chain of network states, the number of agents (A) in
network states will be represented of a multidimensional Markov chain space vector, as
follows in Eq. (1).
106 Hossam el-ddin Mostafa

⎡ ANS ⎤ ⎡ ANS1 ANS2 L ANSτ ⎤


⎢A ⎥ ⎢ ⎥
A ACS2 L ACSτ
⎢ CS ⎥ ⎢ CS1 ⎥

A = ⎢ AUS ⎥ = ⎢ AUS1 AUS2 L AUSτ ⎥ (1)
⎢ ⎥ ⎥
⎢ AAS ⎥ ⎢ AAS1 AAS2 L AAS2T +T +T ⎥
⎢A ⎥ ⎢ ⎥
P W L

⎣ OLS ⎦ ⎢⎣ 1 2 L AOLS ⎥⎦
Where A : Total number of network agents.
ANS : Number of network agents in the normal state (NS).
ACS : Number of network agents in the choosing state (CS).
AUS : Number of network agents in the updating state (US).
AAS : Number of network agents in the alerting state (AS).
AOLS : Number of network agents in the on-line state (OLS).
τ : Fetching time of data from the MBC (in sec).
TL : Lasting time of registration request (in sec).
TP : Propagation time between nodes (in sec).
TW : Wasting time between agents (in sec).

This provides that the network throughput, Th, is represented by the number of
agents in active state (on-line state) of Eq. (2)

Th = No. of active agents = AOLS (2)

Equations (1) and (2) simply show that the throughput of our network of a HA-
based decentralized user-mobility with EPA-selection is a function of the number of
agents in other various network states, i.e., is a function of different network
parameters, τ, TL, TP, TW, …. This will help network designers in choosing the proper
system settings.
Motivated by these concerns, and by looking at the problem from a practical and
commercial point of view, we are better able to interpret the future results of our
opportunity and so build our intuition. Thus, some of the current operational benefits of
the HA-based scheme seem obvious: new initiatives in the MIP protocol to the access
interruption, better macro-mobility service and performance, and built-in QoS.
However, a number of barriers must be overcome before the implementation of the
HA-based scheme. The biggest question will be what the business need and customer
service impact are for moving from current FA-based to HA-based configuration. We
believe that the later case is considered as an excellent opportunity in data networks to
improve the decentralization capability in order to avoid the access interruption.
Home Agent-Based Decentralized User-Mobility with EPA-Selection 107

5 Conclusions
With the explosion of the Laptop industry, location will no longer be able to disconnect
and influence our frequency of communication and users became more reliant on
mobility. This need for mobility has driven companies, standards bodies and industry
forums to spend millions of dollars on the research and development (R&D) of
Laptops and protocols to create a seamless connection through and to the home subnet,
which is affordable, efficient, and transparent to the basic mobile-IP standards.
Therefore, dynamic macro user-mobility, in contrast to the nomadic user-mobility,
outside home subnet is to the centric of all aspects in this work. This paper addressed
the more fundamental question of the appropriate level of effectively for a home agent-
based decentralized user-mobility using an EPA selection, and rather understood the
impact of this scheme and mobility resource management algorithms, on the QoS of
the system for different parameters in wireless networking infrastructure. Also, initial
results, primary business issues, key innovations, and the expected impact on the
commercial and marketing aspects were described.

Acknowledgement: This work is supported by the Slovak Science Grant Agency,


VEGA, No. VG 1/0157/03, under the project entitled “Methods and tools for
development of the secure networked and distributed mobile computer systems and
their management II.”

References
1. Jamalipour, A.: The Wireless Mobile Internet: Architectures, Protocols and
Services. John Wiley & Sons Ltd., England, 2003.
2. Perkins, C.E.: Mobile IP. IEEE Commun. Magazine, Vol. 35, No. 5 (1997), 84-99.
3. Son, W.: Mobile IP. 2003. http://williamson.cx
4. Cisco Systems: Cisco Mobile IP. 2004. http://www.cisco.com/go/mobile_ip/
5. Stiller, B., Braun, O., Heursch, A., Racz P. (edts.): Internet Economics II,
Technical Report No. 2003-01, University of the Federal Armed Forces, Munich,
Germany, 2003.
6. Jue, J., Ghosal, D.: Design and Analysis of a Replicated Server Architecture for
Supporting IP-Host Mobility. ACM Mobile Computing and Commun. Revue, Vol.
2, No. 3 (1998), 16-37.
7. Perkins, C.E., Johnson, D.B.: Route Optimization in Mobile-IP. 1997. Draft-IETF-
mobileip-optim-06.txt
8. Fukuda, A., Tasaka, S.: The Equilibrium Point Analysis-A Unified Analytic Tool
for Packet Broadcast Networks. In: Proc. of IEEE Globecom’83, San Diego, CA
(1983), 33.4.1-33.4.8.
Advanced Network Approaches
for Wireless Environment
Branislav JARÁBEK∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
beejay@orangemail.sk

Abstract. An ad-hoc network is a special kind of network, where all


of the nodes move in time. So the topology of the network changes as
the nodes are in the proximity of each other. Ad-hoc networks are
generally self-configuring, because of the concept of no stable
infrastructure takes a place. There are two different research areas
according to wireless networks: “Networking for Pervasive
Computing”, and “Wireless Ad-Hoc Networks”. This paper focuses
on a Service Discovery problematic from the first area – describes
existing discovery protocols as JINI, UPnP, etc. – and routing
algorithms in MANETs from the network point of view, which are
now-a-days as experimental internet RFCs.

1 Introduction
Wireless networks in today meaning are usually set up with a centralized access point
for each area of connectivity. The access point has knowledge of all devices in its area
and routing to them is done in a table driven manner. Following the trend of mobility,
it becomes important to give users the possibility of finding service they need
anywhere in the network. Users would like to obtain access to services automatically,
without reconfiguring their system. Especially with mobile devices dynamic discovery
of services in other than home or corporate network and automatic network
configuration will be very useful.
An ad-hoc network is a special kind of network, where all of the nodes move in
time. So the topology of the network changes as the nodes are in the proximity of each
other. Ad-hoc networks are generally self-configuring, because of the concept of no


Supervisor: doc. Ing. Margaréta Kotočová, PhD., Institute of Computer Systems and
Networks, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 108-115.


Advanced Network Approaches for Wireless Environment 109

stable infrastructure takes a place. Each node in the network must be able to take care
of routing of the data – and this is the domain of ad-hoc routing. So the concept of
centralized network with pre-defined central routing tables could be applied only with
difficulties or with the loss of the advantage of “on-the-fly” nodes changing.
There are two different research areas according to described problems in wireless
networks [1]. First is Service Discovery Algorithms, which focuses on service
propagation and discovery. Second research area is “Mobile Ad-Hoc Network”, which
maintains design, prototype and evaluates protocols and algorithms to facilitate
adoption and use of wireless ad-hoc networks for appropriately selected application
areas and facilitate development of standards for such networks.

2 Service discovery
Future software services and automated devices will exist in large numbers and will
operate in a networked world where they can never be quite sure about the connectivity
available, about the other services and devices nearby, or about the state of the network
neighborhood a few minutes in the future. In such uncertain environments, individual
components will need to discover and maintain awareness of their surroundings and to
configure and adapt themselves in response to changing situations.
The beginnings of the necessary capabilities for service discovery have emerged
over the past few years in the form of service and device discovery protocols, such as
Jini Networking Technology, Universal Plug-and-Play, (UPnP) the Service Location
Protocol (SLP), Bluetooth service discovery, the Salutation Consortium protocol suite.
Despite differences, all of these initiatives aim to allow small collections of
commercial devices and services to auto-configure, to cooperate, and to adapt to
changes.

2.1 Service Location Protocol (SLP)

The Service Location Protocol is developed by the IETF working group called SvrLoc
[2]. Focus of this group is to design a vendor-independent standard based on TCP/IP
network. SLP architecture consists of three main components: Service Agents – are
service careers, takes a place somewhere in the area (location), which is advertised
with service characteristics. User Agents – are “client” applications, which use
services, so they are service discoverers. Directory Agents – are collectors of
information received from Service Agents and they responds to User Agents on their
queries. They could also create different groups of services and service agents and
categorize them.
The concept is very simple. Each new service must register its service to the
Directory Agent. When a user wants a certain service, the User Agent asks Directory
Agent for available services in the network. Directory Agent sends appropriate
addresses and characteristics and user could select and use one.
The main goal before this concept could be reliable is – how to find a Directory
Agent. There are three different methods defined: static – SLP agent obtains an
110 Branislav Jarábek

address to Discovery Agent via DHCP while connecting into the network, active –
User and Service Agents request to the multicast group and listening Directory Agent
replies directly via unicast, passive – Directory Agent periodically sends multicast
advertisements and User and Service Agents listen to them, and after receiving that
multicast are able to communicate via unicast.
There is also a concept, which omits Directory Agent. If there is no DA (for
example small home networks) UA repeatedly send multicast requests for a service
until one or more listening SAs send out their response via unicast.

2.2 JINI

Jini technology [3] is based on the Java language. Jini creates an issue of how devices
connect with each other in order to form a simple ad-hoc network (a Jini “community”)
and how these devices provide services to other devices in this network. Jini consists of
architecture and programming model.
Each Jini device must have running a Java Virtual Machine. The architecture
principles are similar to that of SLP. Devices and applications register within Jini
network through a Discovery and Join process. Application also places itself into the
Lookup Table on a lookup server (always needed). Besides pointers stores Lookup
Table also Java-based program code for these services. This means that services may
upload device drivers, an interface, and other programs that help user to access the
service. When client wants to utilize the service, the object code is downloaded from
the Lookup Table to the JVM of the client. This code mobility replaces the necessity of
pre-installing drivers on the client.

2.3 Bluetooth SDP

Bluetooth is technology created for wireless short range transmission. Bluetooth


protocol stack contains also a definition of the Service Discovery Protocol (SDP). This
protocol is designed to categorize and to advertise the services provided by each node.
But only advertise. It is specifically developed for this “short range” environment.
Discovering could be done via searching for service by service attributes, searching for
services by service type and browsing without any service characteristics. SDP does
not cover accessing services. Any other mechanism as selection and accessing are out
of scope of SDP. But there are co-existence patterns with other service discovery
protocols, but it does not require them.

2.4 UPnP

UPnP Device Architecture [4] is more than just simple extension of the plug and play
peripheral model. “Universal” means that no device drivers are needed – common
protocols are used instead. UPnP devices can be implemented using any programming
language.
Advanced Network Approaches for Wireless Environment 111

Each device must have a DHCP client to connect to the network and obtain
appropriate address. Then five steps take care about device and service handling:
1. Discovery – discovery protocol (Simple Service Discovery Protocol – SSDP)
allows device to advertise its service to control points on the network.
Similarly, when a control point is added to the network, the UPnP discovery
protocol allows that control point to search for devices of interest.
2. Description – has two parts: device and service description. Device
description contains vendor specific information. For each service included,
the device description lists the service type, name, and other access URLs.
Service description includes a list of actions with parameters, the service
responds to, and also list of variables of the state of the service.
3. Control – a control point can ask services to invoke actions and receive
responses. To do this, a control point sends a suitable control message to the
control URL. In response, the service returns any results or errors from the
action. Action could change state of the variables that describe internal state –
events are published to all interested control points (see eventing).
4. Eventing – uses standard publisher-subscriber model.
5. Presentation – retrieving it is a simple HTTP-based process.

3 Mobile Ad-Hoc Networks (MANETs)


There are plenty of routing algorithms suitable for ad-hoc networking problems.
Conventional approaches to routing like link state or distance vector are well tested.
But the main problem is that they are made for a network with static topology. They
will be working well for MANETs with low dynamic parameters, but they could be
devastating for larger MANETs because of their dependency on periodicity of control
messages and potential large number of destination hosts (network nodes). Due to
mobile devices resources (battery power, bandwidth, CPU – for example PDAs) and
wireless environment constraints (e.g. not bi-directional) both link-state and distance
vector wastes resources trying to maintain routes to all reachable destinations and must
be modified to achieve new performance issues. [5, 6].
MANET IETF working group will develop two standard track routing protocols
for: Reactive MANET Protocol (RMP) and Proactive MANET Protocol (PMP). From
the most common candidates for reactive protocols DSR (Dynamic Source Routing)
and AODV (Ad-hoc On-demand Distance Vector, experimental RFC) routing and
from proactive approach OLSR (Optimized Link State Routing) and Topology
Broadcast (Dissemination) based on Reverse Path Forwarding (RFC Draft) are
described below.
Reactive Ad-Hoc Routing Algorithms use on-demand routing, so the routes are
only requested when they are needed. This approach stores only active routes in
memory and does not waste bandwidth maintaining information about unused routes.
112 Branislav Jarábek

Main disadvantage is the latency before first packet is sent caused by the route
discovery.
Proactive Ad-Hoc Routing Algorithms (table-driven) maintain routes to all nodes
in the network, so they heavily rely according to tables. Difference to reactive is that
there is no need to construct new route before transmitting but only fetch the next hop
node from routing table.

3.1 Dynamic Source Routing (DSR)

Main concepts of DSR [7] are route discovery, route caching and route maintenance.
Routing by this method means that the path is discovered. The first data (this means
that no data has been sent to that destination before) initialize the route discovery from
the source to the destination.
Route discovery: Can be done in two ways – active or passive. A source node can
flood the network with a route request (RREQ) for a node it needs a route to. Its
neighbors propagate this RREQ in the same manner until it reaches the destination
node or a node that already has a route to the destination. Each hop of the RREQ is
recorder within the RREQ message. The second way for a node to discover a route is
by caching RREPs that it happens to pass on or overhear from other nodes.
Route caching: Upon arrival of the RREQ at the destination node or at a node that
already has a route for the destination, the inverse route is cached. In the case of a node
that already has a route, the existing route is appended. A route reply (RREP) is then
sent back the same way the RREQ traveled. The RREP contains a list of all the
intermediate nodes between source and destination. On the way back, the RREP is
cached by all intermediate nodes it passes on the way. When the RREP reaches back to
the source, the source can send the data and cache the new route for future use.
Route maintenance: Whenever a node discovers that the link to one of its
neighbor nodes has failed, it will send a route error (RERR) packet to the source of any
cached routes that use the failed link. This RERR will propagate through all
intermediate nodes that also have cached this route. Upon receipt of a RERR a node
will update their caches accordingly and purge the now failed route. In the case of
nodes using promiscuous listening, the node should note that all RERRs might not be
heard (the node may have moved) and the route should be treated differently than route
where the node is an intermediate node.

3.2 Ad-hoc On-demand Distance Vector Routing (AODV)

As the name applies, this protocol adds specific on-demand modification to the
distance vector routing algorithm [8]. The reason to this is to acquire low bandwidth
cost as DSR has with lower time to discover a route. The idea behind is to use only
local broadcast and also modified discovery algorithm.
In route discovery AODV uses RREQ packets as DSR in the same meaning –
packet is broadcasted into the network. The difference is that the hosts on the way of
RREQ packet to the destination maintain “back pointers” from where they received the
Advanced Network Approaches for Wireless Environment 113

packet. This creates reverse path from the destination to the source. When the packet
reaches the destination (or a host whit path to the destination), the destination sends a
RREP packed back, which validates reverse path and sets up the forward path. All
hosts, which maintain “back pointers” and do not receive RREP packet in specified
time, will de-allocate the pointer. This approach guarantees that the only one route is in
use. So this is the difference to DSR – algorithm first builds up a tree of possible paths
from source to destination and then validates only one of these routes. The only one
shortest path can be selected when intermediate nodes uses the sequence numbers of
the RREQ and RREP packets (in opposite to DSR which can multiple routes). So this
algorithm is better to use in larger networks (path is not stored in packets, only one
route from the tree of paths is used).
Route maintenance: If the source node moves, nodes on the path will send a
special RREP. If next node fails to communicate, the node will send information
upstream the path (RREP failure packet). All nodes will remove appropriate
information from their route caches.
Local connectivity management: AODV uses local HELLO messages which
transmit to the immediate neighbors. These messages detect link failures in active
routes as described before.

3.3 The Optimized Link State Routing Protocol (OLSR)

OLSR [9] is an optimization of a link state protocol for mobile ad-hoc networks. OLSR
uses Multipoint relays (MPRs) and MPR Selectors to reduce the bandwidth cost of
maintaining routes by limiting the broadcast of link-state updates. So each node selects
a subset of its neighbors, as MPRs and these nodes are the only ones that forward
packets from this node. The MPRs record that another node has selected it as MPR –
so node is MPR Selector for MPRs.
OLSR uses local broadcast of HELLO messages, which are no forwarded more
than one hop – so nodes maintain bi-directional links. Each HELLO message contains
a list of neighbors, which this node has received a HELLO message from. This is
recorded in a neighbor-table with sequence numbers. If a node receives HELLO
messages from all of its neighbors, it has knowledge of all nodes in the distance of two
hops. The MPR set should be smaller than the set of neighbors, to take advantage of
relaying through another host. The MPR set is included in HELLO messages, so the
nodes, which take this node as MPR, know to which nodes is this node MPR Selector.
The MPR set is recomputed whenever the link to the neighbor node goes down or a
new node is added.
For calculating the routing table OLSR uses a Topology Control message. This
packet is broadcast to all nodes of the network, using MPRs and contains the nodes for
which source node is MPR Selector. These packets can be used by the node as the list
of last-hop nodes for destination node and are stored in topology table with a sequence
number. Constructing of the route table begins with appending of entries of topology
table (node, last-hop node) starting from each destination in the network and followed
until a node in neighborhood is the last-hop node. So the complete routing table of the
114 Branislav Jarábek

network is created and only optimal routes with minimal hop are chosen. When any of
the entries in topology or neighbor table change, the routing table has to be
recalculated.

3.4 Topology Broadcast (Dissemination) based on Reverse Path


Forwarding (TBRPF)

TBRPF [10] is pro-active link-state routing protocol based on existing reverse path
forwarding algorithms. It has two modes of operation and two main system functions:
discovery and routing.
The operating modes Full Topology (TBRPF-FT) and Partial Topology (TBRPF-
PT) are different in amount of information each node has. As name implies in full
topology mode each node has knowledge of all links in network. In partial topology
mode, a node has enough knowledge to compute minimal route (min. hop distance) to
any other node. Each topology has its advantage in other network: FT mode is suitable
in open networks with high scattering and PT mode is better for use in dense networks
where the amount of routing information is high and all the information is not needed.
Like OLSR, TBRPF sends a Hello message to first-hop neighbors. But the
message differs – TBRPF sends out only Ids of new and lost neighbors in Hello
message, not the complete set. A “new node” is node that has been recently seen, but
two-way link has not been established. A two-way link is in the meaning when the new
node responds with a HELLO and receives an update request. This brings decreasing
of control data, which is sent over network, and increased frequency of messages could
minimize convergence time.
Topology update and routing function: Each node keeps a source tree of links,
which determines the network topology. A link (a, b) is in the source tree of a node if it
is reported by the next hop parent node to be the shortest path to a.
The source tree is the basis for a node's reportable sub tree. The report from node
b to node a include b's links to all its neighbors and the branch of its source tree rooted
at the node that b is the next hop of for a to reach.
In FT and PT mode forwarding of update messages is done only for link, which
does not contain a leaf node. PT also restricts forwarding – so only changes of source
tree of the node are reported. In this approach each node creates its source tree and
computes route to the destination by computing the minimal-hop path.
TBRPF also uses aggregation of control messages to minimalize the total amount
of messages sent.

4 Conclusions
This paper has cleared research in two major areas of wireless networking of today.
The focus has been given to the new service oriented view on the computer network
and also routing standards has been considered. Regarding the mobile device’s reduced
power supply, the radio transmission have to be as low as possible. So on-demand
Advanced Network Approaches for Wireless Environment 115

(reactive) protocols have been introduced in opposition to proactive, as they do not


need constant topology updates.
It will be possible to aim next work to couple routing techniques with basic
discovery services (as simple as for example Bluetooth SDP has) in small networks
and measure performance against severity of routing and discovering separately.

Acknowledgement: This work has been supported by the Grant Agency of Slovak
Republic grant No. VG1/0157/03.

References
1. The Advanced Network Technologies Division of National Institute of Standards
and Technology, http://w3.antd.nist.gov
2. Service Location Protocol, RFC 2165, June 1997,
http://www.ietf.org/rfc/rfc2165.txt
3. AR-Jini™ Architecture Specification, Sun Microsystems, January 2005,
http://www.jini.org/nonav/standards/davis/doc/specs/html/jini-spec.html
4. UPnP™ Device Architecture version 1.0, Jun 2000,
http://www.upnp.org/download/UPnPDA10_20000613.htm
5. Larson, T., Hedman, N.: Routing protocols in Wireless Ad-Hoc Networks – A
Simulation Study (Master Thesis), Lulea Tekniska Universitet, ISSN: 1402-1617,
1998.
6. Mobile Ad hoc Networking (MANET): Routing Protocol Performance Issues and
Evaluation Considerations, RFC 2501, January 2001,
http://www.ietf.org/rfc/rfc2501.txt
7. The Dynamic Source Routing Protocol for Mobile Ad Hoc Networks (DSR), RFC
Draft, July 2004, http://www.ietf.org/internet-drafts/draft-ietf-manet-dsr-10.txt
8. Ad hoc On-Demand Distance Vector (AODV) Routing, RFC 3561, July 2003,
http://www.ietf.org/rfc/rfc3561.txt
9. Optimized Link State Routing Protocol (OLSR), RFC 3626, October 2003,
http://www.ietf.org/rfc/rfc3626.txt
10. Topology Dissemination Based on Reverse-Path Forwarding (TBRPF), RFC 3684,
February 2004, http://www.ietf.org/rfc/rfc3684.txt
Internet Single Sign-On Systems
Radovan SEMANČÍK∗
nLight, s.r.o.
Súľovská 34, 812 05 Bratislava, Slovak Republic
semancik@nlight.sk

Abstract. This document describes the requirements and general


principles of Internet Single Sign-On systems. The general model of
Internet SSO system is described. The Liberty ID-FF, WS-Federation,
Shibboleth, SXIP and LID specifications are considered and of these
specifications suitability for implementing an Internet SSO system is
evaluated.

1 Introduction
Applications based on the HTTP and HTML are the most commonly used mechanisms
for providing live content on the Internet, but the use of independent strong
authentication systems in each Internet application directly is inefficient. The solution
may be the outsourcing of authentication services to trusted third parties. This
document provides overview of systems that allow user to authenticate on one Internet
site and use services on the other Internet site. These systems are referred to as Single
Sign-On (SSO) systems, because they allow single authentication for multiple services.

1.1 Requirements

The requirements for web application Simplified Sign-On system for the usage on the
Internet are defined as follows:
• It must be based on open protocols and standards.
• It must support cross-organization operation.
• It must provide a mechanism to securely share user attributes across
organizational boundaries.
• It must support privacy features.


Supervisor: doc. Ing. Margaréta Kotočová, CSc., Institute of Computer Systems and
Networks, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 116-123.


Internet Single Sign-On Systems 117

• It must support standard web browser that implements current versions of


HTTP, HTML and accompanying standards.

2 Internet SSO Systems Principles

The goal of Simplified Sign-On system is to securely transfer user's identity, attributes
and current authentication status of a user from source site (Identity Provider) to the
destination site (Service Provider). The trust relationship must be established between
source and target sites for a source site to trust the target site's requests and for a target
site to trust the source site's identity statements. Establishing and maintaining this trust
relationship is out-of-band for most SSO systems. The described Internet SSO systems
follow the proxy-based true SSO model according to [1].
The representation of user in computer system will be called in this work persona.
The persona contains attributes. The physical data structure that stores the persona
attributes is called account.

2.1 User Identifiers and Attributes

The persona identifier may be presented to the target site in different ways:
• Direct Linking: Provide the same persona identifier (e.g. username) as the
user has established with the source site.
• Indirect Linking: Provide a pseudonym for a persona. The pseudonym an
identifier that is different as the primary persona identifier established with
the source site, but is fixed in time for the same persona and the same target
site. Indirect linking may be used to implement pseudonymity [2].
• No linking: Do not provide identifier or provide an anonymous handle valid
for a single session or a part of session. No linking is used in anonymity
scenarios [2].

2.2 Message Exchange

All considered SSO systems employs similar mechanism to transfer authentication


status from source to destination site. In all these cases, browser redirect or form
processing capabilities are used to transfer security tokens between sites. The process
is illustrated on Figure 1 and it consists of following steps:
1. The user requests resource on target system (service provider).
2. Target site does not recognize the user (has no valid session for the
user/persona). The target site constructs the authentication request and
returns it to the user's browser in the response. The response is returned in the
form of HTTP redirect or HTML form that will redirect user interaction to the
source (identity provider) site.
118 Radovan. Semančík

3. The authentication request is received by source site (identity provider). The


source site processes the request, and applies any relevant policy.
4. The source site may authenticate the user, if not already authenticated or if
any policy or the request requires re-authentication.
5. The source site constructs the authentication response, which contains the
results of persona identity evaluation. The authentication response may
contain a security token that will prove persona identifier and/or attributes to
the target site. The authentication response is returned in the HTTP response
to the user's browser in a form of HTTP redirect or HTML form that will
redirect user interaction back to the target (service provider) site.
6. The authentication response is received by the target site. The response is
processed and the security token is evaluated. For the response and token
processing it may be necessary to contact source site directly (6a), for
example to resolve references in the response. Note that the token itself may
be passed by reference in the authentication response and it may be needed to
dereference it by direct communication to the source site. After the response
and any related security tokens and processed the persona identifier and/or
attributes are determined.
7. The target site applies any relevant policies to the original access request (step
1) combined with the information determined in step 6. If the request is
allowed, the target site will in most cases establish a local session with the
user's browser. The local session will help avoid quite significant overhead of
future re-authentications.

Source 6a Target
(Identity Provider) (Service Provider)
T
A ut

st

T
Aut

st
q ue

q ue
est
hen

h
Aut

ent

n Re
re q u

d re
t ic a

1
icat

en t
h

3 2 6
ent

cate
ti o n

catio

5
rc e

7
ion

Con
icat

ou

enti
res

enti
r eq
ion

Res
pon

Auth
ues

Auth

T 4
se

Redirect

User (browser)

Figure 1 Generic SSO message exchange


Internet Single Sign-On Systems 119

3 SSO Systems Overview

The results of Internet SSO systems evaluation are summarized in the following
sections.

3.1 Liberty Identity Federation Framework (Liberty ID-FF)

The Liberty ID-FF system [3] is build on top of SAML and uses SAML assertions as a
security tokens, therefore it is dependent on SAML. The modification of Liberty
specification for other, non-SAML security tokens may be difficult.
The Liberty specification mandates the use of pseudonyms by default. This
requirement may help to enforce good privacy features to all Liberty-compliant
implementations.

3.2 Web Services Federation Language (WS-Federation)

The WS-Federation specifications [4] are built on top of WS-Trust and WSS: SOAP
Message Security (WS-Security) specifications. The WS-Security specifications leave
a lot of details to the implementer’s decisions and to be defined by the service policy.
Although that is good for flexibility, it brings additional degree of complexity to the
system. The implementing systems may not be interoperable by implementing different
subsets of specifications and/or using non-compatible policies.
The privacy decisions (e.g. use of pseudonyms) is left to the implementers. This
may in practice lead to the implementations, that will not adhere to the best practice
and the level of privacy in WS-Federation-compliant systems may be lower (in
average).

3.3 Shibboleth

The Shibboleth system [5] is built on top of SAML specifications. The system
implemented using Shibboleth specifications will need to specify a lot of local details,
e.g. name identifier types, linking policies, etc. This type of flexibility may lead to
situation that two shibboleth-compliant implementations will not interoperate.
The shibboleth will depend on other specification to define account linking, if
such will be needed. The use of transient name identifiers allows good degree of
privacy, but for any practical purpose will require a solid attribute service.

3.4 SXIP Network

The SXIP protocol [6] has two variations: simple and XML commands. The variation
using simple commands provides only minimal security. Even the use of HTTPS does
not add any real security to the simple command exchange.
120 Radovan. Semančík

Some of the SXIP XML commands include XML digital signature element that
should protect the integrity of SxipML message. However, no method or guidelines are
documented for creation and validation of these signatures.
The storex and fetchx command messages are not authenticated, which may lead
to the implementations that may allow anyone reading or setting arbitrary persona
attributes.
The use of globally unique GUPI at several member sites makes it easy for the
member sites to collude and correlate persona activities at several sites. This is
partially mitigated by the use of different personae for different member sites, but in
practice this approach may be inconvenient or maybe even unfeasible.

3.5 Lightweight Identity (LID)

The LID system [7] uses URL as a persona identifier and GPG signature as a security
token. LID URL as an identifier may leak information, especially in self-hosting
scenario as proposed by LID documentation. For detailed explanations see section 4.2.
GPG public key validation is left on simple “callback” method. No other method
is mandated by the LID documentation. The described simple method can be
dangerous when using HTTP protocol, for example due to the DNS attacks [8]. While
using HTTPS method to get public key, using SSL/TLS brings a dependency on X.509
PKI. The result is that LID uses two different PKI systems (X.509 and GPG), that are
in principle and features nearly the same, but not compatible.

4 Discussion
The considered web SSO systems are similar in the generic SSO mechanism, but are
different in the following areas:
• The method of identifying personae and accounts, the way of generating and
assigning identifiers. Global identifiers are better suited for tightly-coupled
systems that are same organizational control or share common policies. Local
identifiers are better suited for loose-coupled systems that cross organizational
boundaries.
• The method of linking accounts and personae in different target and source
systems. The direct linking is desirable only when user privacy is not a
concern, it is not well suited for the Internet environment. The pseudonymity
of indirect linking or anonymity of no linking is better suited to privacy-
sensitive environments. The “no linking” SSO case will in practice require
secure and interoperable attribute service.
• The level of detail that is specified in the documents and the freedom that is
left for system implementers.
The Table 1 summarizes features of considered SSO systems and the next
subsections provide discussion on some aspects of SSO system's architecture and
design.
Internet Single Sign-On Systems 121

Tab. 1. Summary of SSO system's features


System Version Security Linking Persona Extensible to
Tokens Method Identifier Web Services
Liberty ID-FF 1.2 SAML Indirect Local Yes
WS-Federation 1 WS-Trust Not specified Not specified Yes
Shibboleth Working SAML None, other Transient, No
Draft 09 other
LID GPG Direct Global (URL) No
Jan 3, 2005
signature
SXIP 1.0.4 None, XML Direct Global No
signature (GUPI)

4.1 Persona identifiers

The Single Sign-On systems need a way to link several account. The linking is
implemented by associating persona or account identifiers on different systems. There
are two approaches to the management of persona identifiers:
• Global persona identifiers. The persona identifiers are allocated by central
authority that guarantees global uniqueness of the identifier. The global
uniqueness of the identifier allows direct linking of accounts on the global
(Internet) scale.
• Local persona identifiers. The persona identifiers are allocated by the system,
where the persona originated. These identifiers are unique only in the scope of
the source system. For the purposes of persona or account linking, the target
site must accept the identifier in this form or (more frequently) apply
appropriate identifier mapping.
While the direct linking and global persona identifiers may be the easiest
scenario, global identifiers shared by many sites may be used to correlate user
activities on several systems and thus reveal personal information without user
consent. To overcome this problem, lower level virtual personae (with different
identifiers) may be used as pseudonyms. If this approach is deployed in the Internet
scale, the persona management may become difficult and may need automation. The
automatic pseudonym persona management is technically close to the indirect linking
scenario, and the indirect linking may be considered as better approach for the Internet
environment.

4.2 Self Hosting of Source Sites

One way of storing identity information is to host a source site on a system that is
under user's sole control. As this concept may seem attractive from the privacy point of
view, it in fact may be undesirable in the practice:
• URLs of self-hosted source site may leak information.
122 Radovan. Semančík

• The maintaining of site security on the operating system and application by a


non-expert user may be a security hazard.
• The trust relation between source site and target site may not be
unidirectional. The trust to the source site in the self-hosting scenario may be
questionable, and the high number of self-hosting sites with whom to
establish trust may make the process unfeasible.
The self-hosting scenario is technically proxy-based true SSO system [1], but may
be regarded a local true SSO system from the organizational control point of view. The
self-hosting of source sites brings only one advantage: control over the stored data. But
the control over data is lost when transmitted to other sites and even control of the
stored data itself may be questionable. The self-hosting scenario will in most cases
likely lower the privacy level.

5 Conclusions
This document described the generic model for Internet Single Sign-On mechanisms
and provided an overview of existing Internet SSO systems. The Liberty Alliance ID-
FF and the WS-Federation were found as the most advanced and flexible Internet SSO
systems, suitable for general use. The WS-Federation specifications are quite generic,
lack a considerable amount of details and the early WS-Federation implementations
may have interoperability problems. However, the WS-Federation may become a good
platform for SSO services in the future, extended to the web services area as well. The
Liberty Alliance ID-FF specifies a practical SSO system built on top of SAML
specifications. The level of detail is sufficient for good interoperability, the
dependency on SAML is reasonable in the Internet environment. The Liberty Alliance
also specifies extensions to ID-FF for web services environments (ID-WSF). The
Shibboleth specifications also depends in SAML, but the level of details is
considerable lower compared the Liberty case. The Shibboleth system is suitable for
large communities that are mostly composed of independent organizations (e.g.
academic community). The SXIP and LID SSO systems in its current state are not well
suitable for the Internet environment. They provide only minimal privacy features, use
global identifiers and feature limited standards support. These systems may be suitable
for closed communities or for the environments where security and privacy is not a
concern.
While all these systems use similar mechanisms, their properties vary
considerably. Especially the use of persona identifiers and pseudonyms as well as the
use of attribute services will require further study for the SSO systems to be deployed
in secure and privacy-supporting manner.

References
1. Pashalidis, A., Mitchell, C.: A taxonomy of single sign-on systems. Lecture Notes
in Computer Science, Vol. 2727, Springer-Verlag, Berlin (2003) 249-264.
Internet Single Sign-On Systems 123

2. Pfitzmann, A., Köhntopp, M.: Anonymity, Unobservability, Pseudonymity, and


Identity Management A Proposal for Terminology. Lecture Notes in Computer
Science, Vol 2009, Springer-Verlag (2000) 1-9.
3. Cantor, S., Kemp, J.: Liberty Bindings and Profiles Specification, Liberty Alliance
Project Specification, 2003.
4. Bajaj, S., et.al.: Web Services Federation Language (WSFederation). BEA, IBM,
Microsoft, RSA Security, Verisign, 2003.
5. Shibboleth Architecture Protocols and Profiles,
http://shibboleth.internet2.edu/shibboleth-documents.html.
6. The Simple eXtensible Identity Protocol (SXIP) Reference,
https://sxip.net/archive/specs/sxip-reference.pdf.
7. Ernst, J.: Light-Weight Identity. NetMesh Inc., 2005.
8. Bellovin, S. M.,: Using the Domain Name System for System Breakin. 5th
USENIX UNIX Security Symposium (1995) 199-208.
Software
Engineering
Specialization of Object-Oriented
Programs Written in Java Language
Igor DYSKO∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
igor.dysko@gmail.com

Abstract. Design patterns offer many advantages in software


development, but introduce overheads into programs. These overheads
and inefficiency can be eliminated by specialization, which adapts a
program code to a specific use. In this paper, we show how to
eliminate some of overheads caused by virtual methods calls. We
propose the specialization of abstract factory and prototype design
patterns that are used concurrently and we discuss how aspects can be
used for virtual calls elimination. We have experimentally verified the
usage of designed specialization pattern.

1 Introduction
Using of design patterns in software development offers many advantages, such as
code reusability, easier program extensions or others. It supports development and
maintenance of software applications and systems. On the other side, design patterns
may introduce inefficiency into programs. It is possible to eliminate this disadvantage
by specializing the program, which adapts this program to a specific execution context
[5]. An application that performs specializations is an automatic specializer.
Specialization may optimize object-oriented programs, especially those ones that
are written according to design patterns. In object-oriented programs, overheads
usually result from genericness. Approach, which prefers using generic methods and
components, is in many cases at the expense of effectiveness. One of the factors that
influence program effectiveness is usage of virtual calls.
Specialization of a program is a transformation technique, which adapts a generic
program to a specific execution context. There are various specialization methods that


Supervisor: prof. Ing. Pavol Návrat, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 127-132.


128 Igor Dysko

can be used for program specialization [1, 5, 8]. We will point our interest only to the
specialization technique named partial evaluation.
Execution of an object-oriented program is determined by a sequence of
interactions among objects. Further specification of program context makes it possible
to improve some interactions, so the static interactions will be evaluated in advance.
Specialization substitutes generic method calls by specialized methods calls.

2 Design Patterns
Design patterns represent the way of designing and implementation of a specific
problem. Design patterns were well explained and documented by Gamma et al. [3].
The authors divided all patterns into three categories - creational patterns, structural
patterns and behavioral patterns. Each of these groups focuses on different kind of
problems. The first one describes the design possibilities of creating new objects, the
second one arranges relationships among objects and the third one focuses on
generalizing of object behavior.
Using of design patterns enhances the process of software design and allows
simplified reusability and maintenance but in consequence of excessive generalization
it introduces overheads into programs. These overheads could rise from virtual method
calls, which may be in certain cases eliminated by specialization. In this paper, we will
show the basic principles of virtual calls elimination in the design patterns prototype
and abstract factory.

3 Abstract factory and prototype specialization


Abstract factory and prototype are creational patterns, which main task is to build new
objects. We show a specialization of prototype design pattern which is used
concurrently with abstract factory design pattern. The specialization of abstract factory
design pattern was presented by Dysko [2]. We will show how specialization may be
used when more design patterns are used concurrently. We use the same template for
specialization pattern as Dysko [2].

Name: Prototype.
Description: In case the system has to be independent on the product creation, it is
suitable to use prototype.
Structure: The structure of the prototype design pattern was presented by Gamma
et al. [3].
Area: Specialization is focused on the part of the code where new objects are
being created by calling the method that returns an object clone.
Overhead: Cloning methods present virtual calls that could be eliminated.
Approach: Virtual calls of prototype clone method will be replaced by directly by
the method body.
Conditions: Concrete type of the prototype must be known.
Specialization of Object-Oriented Programs Written in Java Language 129

Example: AbstractPrototype interface represents the common interface for


concrete prototypes.

public interface AbstractPrototype extends Cloneable{

public void enter();


public Object clone() throws
CloneNotSupportedException;
}

AbstractPrototype Interface defines two methods, enter and clone. Significant


method is the method clone that returns the copy of the object. Class PrototypeFactory
contains the set of prototypes and methods that return the clones of the prototypes.

public class PrototypeFactory {

private AbstractPrototype _prototype1;


...

public AbstractPrototype makePrototype1(){


try{
return (AbstractPrototype)_prototype1.clone();
}catch(CloneNotSupportedException e){
return null;
}
}
...
}

Methods of abstract factory that call clone methods are being called in a main
method of class Runner.

public class Runner {


private static PrototypeFactory _factory;
...
public static void main(String[] args) {
...
_floor = (Floor) _factory.makePrototype1();
_door = (Door) _factory.makePrototype2();
_wall = (Wall) _factory.makePrototype3();
_room = (Room) _factory.makePrototype4();
...
}
}

We will specialize the part of the code in class Runner where new objects are
being created.
130 Igor Dysko

All methods named makePrototypeX call method clone, which calls the
constructor of its class for the creation of a new object. Replacing the call of
makePrototypeX method, directly by the constructor call, eliminates two virtual calls.
We have replaced virtual method calls directly by the bodies of called methods.
After specialization the class Runner looks as follows:

public class Runner {

private static Door prototypeDoor = new Door();


private static Wall prototypeWall = new Wall();
private static Room prototypeRoom = new Room("office");

public static void main(String[] args) {


...
_floor = new Floor();
_door = new Door(prototypeDoor);
_wall = new Wall(prototypeWall);
_room = new Room(prototypeRoom);
...
}
}

4 Experimental testing
During the testing of specialization, 10 million objects in case of Floor, Door, Wall and
Room classes and 10 thousand objects in case of class Building were created. The huge
number of objects was created due to the requirement of accurate time slices
measurement. We have measured the time of code execution 5 times for each class.
Results of the testing are listed in the following table (Tab. 1). Measured times are
mentioned in milliseconds. A row for specialized code contains letter “s” after the
name of the class.

Tab. 1. Results of experimental testing


Class trial 1 trial2 trial 3 trial 4 trial 5 average speed up
Floor 441 440 430 440 430 436,2
Floor s 310 330 291 300 300 306,2 29,8%
Door 640 641 681 651 661 654,8
Door s 591 591 590 581 600 590,6 9,8%
Wall 1482 1492 1492 1482 1503 1490.2
Wall s 1412 1442 1442 1432 1432 1432 3.9%
Room 7481 7581 7691 7521 7550 7564,8
Room s 7431 7480 7431 7460 7581 7476,6 1.2%
Building 1032 1011 1042 1012 1011 1021.6
Building s 1001 1011 1032 981 1021 1009.2 1.2%
Specialization of Object-Oriented Programs Written in Java Language 131

Together 10124 10225 10194 10085 10245 10174,6


(Floor, Door,
Wall, Room)
Together s 9834 9674 9614 9734 9674 9706 4,6%

At the end, 10 million objects of the classes Floor, Door, Wall and Room were
created. In this case we measured the acceleration of code that contains the creation of
simple and difficult object together.

5 Results of specialization
The speed up range for the object creation is between 1.2 and 29.8 percents. The lower
limit arose due to the fact that creating a difficult object takes too much time compared
to virtual call evaluation. The highest speed up was achieved by the creation of simple
objects where the time needed for virtual call evaluation is comparable to the time of
simple object creation. The specialization of prototype and abstract factory is beneficial
when it is used for creation of simple objects. The specialization of difficult object
creation reaches the zero speed up.

6 Virtual method calls elimination by using aspects


It is possible to use aspects for eliminating of virtual calls. There are two approaches
that provide virtual call elimination. The first one is dynamic (or run time)
specialization that uses pointcuts and advices. We tested this approach and the results
were not satisfactory. In fact, using aspects for such a dynamic specialization leads to
slow down the speed of a code execution. Usage of aspects for dynamic specialization
introduces overheads into the code, which are bigger than benefit from replacing
virtual calls. Run time specialization by using of aspects is therefore not suitable for
virtual calls elimination.
The second approach (static) is usage of aspects during compilation. New
methods that will be called from original code have to be created and introduced into
original source code. Then the original calls of virtual methods must be replaced by the
created methods.

7 Conclusions
Design patterns offer many advantages in software development but may introduce
overheads into the original code. We presented the way of eliminating some of these
overheads, specifically those ones that are caused by virtual method calls. For virtual
calls replacement, it is convenient to impose the functionality of aspect-oriented
programming.
Introduction of new specialized methods and replacement of virtual calls in the
original source code makes the code less readable and it worsens the efficiency of its
further development. Hence the specializer should be used as a precompiler only.
132 Igor Dysko

Acknowledgement: The work reported here was supported by Science and Technology
Assistance Agency under the contract No. APVT-20-007104.

References
1. Bobeff, G., Noyé, J.: Molding components using program specialization
techniques. In: Eighth International Workshop on Component-Oriented
Programming, Bosch, J., Szyperski, C., Weck W. (Eds.), Darmstadt, Germany
(2003)
2. Dysko, I.: Specialization of Design Patterns. In: ISIM’05 Conference Proceedings
(2005)
3. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of
Reusable Object-Oriented Software. Addison-Wesley, 1995.
4. Návrat, P., Filkorn, R.: A Note of the Role of Abstraction and Generality in
Software Development, Journal of Computer Science, Vol. 1, No. 1, Science
Publications (2005), 98-102.
5. Schultz, U. P., Lawall, J. L., Consel, Ch.: Automatic program specialization for
Java. ACM Transactions on Programming Languages and Systems (TOPLAS),
Vol. 25, No. 4 (2003), 452-499.
6. Schultz, U. P.: Black-box program specialization. Published Technical Report
17/99, Department of Software Engineering and Computer Science, University of
Karlskrona/Ronneby, In: Proceedings of WCOP'99 (1999)
7. Schultz, U. P.: Partial Evaluation for Class-Based Object-Oriented Languages. In:
Symposium on Programs as Data Objects II. Lecture Notes in Computer Science,
Vol. 2053, O. Danvy and A. Filinski (Eds.), Aarhus, Denmark, 173-197.
8. Schultz, U. P., Lawall, J. L., Consel, Ch.: Specialization patterns. Research report
1242, IRISA, Rennes, France, 1999.
9. Schultz, U. P., Lawall, J. L., Consel, Ch., Miller, G.: Towards automatic
specialization of Java Programs. In: Proceedings of the European Conference on
Object-Oriented Programming (ECOOP‘99). Lecture Notes in Computer Science,
Vol. 1628 (1999), 367-390. R.Guerraoui (Ed.), Springler-Verlag, Lisbon, Portugal
10. Smolarová, M., Návrat, P., Bieliková, M.: Abstracting and Generalising with
Design Patterns. In: ISCIS'98 - The 13th Int. Symposium on Computer and
Information Sciences, A. Gürsoy U. Güdükbay, T. Dayar and E. Gelenbe (Eds.),
Belek-Antalya, Turkey, IOS Press, Amsterdam (1998), 551-558.
11. Volanschi, E., Consel, C., Muller, G., Cowan, C.: Declarative Specialization of
Object-Oriented Programs. In: OOPSLA’97 Conference Proceedings. ACM Press,
Atlanta, GA, USA (1997), 286-300.
Object-Oriented Specialization Using
Aspect Programming
Adrián SLAVKOVSKÝ*
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
adrian.slavkovsky@gmail.com

Abstract. Object-oriented programming using design patterns


provides reusability and genericness of software products but causes
overheads what reflects in efficiency. These overheads can be partially
eliminated by specialization. One way how to link original and
specialized code together is to use aspect-oriented programming. This
paper analyzes various means of forming specialized aspect codes into
original code and describes advantages and disadvantages joined with
particular approaches as well as results of specialization improvement
being achieved with them.

1 Introduction
Design patterns in object-oriented approach present a major step towards defining,
formalizing and solving common design problems in software architecture. But their
generality brings inefficiency into the programs. Objects are accessed mainly through
interfaces or abstract classes so there are many virtual calls which have to be evaluated
runtime. Standard compiler optimizations do not fully eliminate these kinds of
overheads. Therefore a program specialization was proposed to solve this problem.
There are many ways how to use specialization. This paper focuses on object-
oriented specialization especially on eliminating virtual calls. Schultz et al. have
defined what to specialize, how we should specialize and where specialization is
effective [5, 6]. He defined a structure of specialization patterns as a complement to
design patterns [7]. Schultz has also described different ways of integration of original
and specialized code. One option is to use aspect-oriented programming. Our work
shows some possibilities of how can aspect code be used during the specialization


Supervisor: prof. Ing. Pavol Návrat, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 133-138.


134 Adrián Slavkovský

process. Two different concepts of aspect interaction were proposed – static, which is
made by introduction and is woven into original code in compile time and dynamic,
which allows us to replace virtual calls with our specialized code when particular call
occurs. At the end specialization example and results are shown which document my
observations of specialization improvement on decorator design pattern.

2 Program Specialization
Specialization is a technique of code transformation. Primary goal of this
transformation is to produce more effective code than the original one. To achieve this,
we need to know some specific information about the context this code is running in.
In object-oriented programming, virtual dispatching represents one source of overhead.
Virtual calls make program control flow more difficult and block traditional compiler
and hardware optimizations, because compiler often does not know the concrete type
of object.
Specialization is supposed to be a complement to compiler optimization but it is
driven explicitly by programmer. He is the one, who chooses the appropriate fragment
of code to specialize and he defines invariant information about fragment's context
(which compiler usually doesn't know) that means he in fact directs the specialization.

3 Specialization patterns
Using design patterns simplifies process of software design and development, but bears
respective overhead. Schultz et al. proposed specialization patterns as a complement to
design patterns in terms of defining the specialization opportunities [7]. Each design
pattern can have corresponding specialization pattern. This pattern contains
information where and what kind of overhead is presented, which parts can be
specialized to eliminate this overhead, what are the conditions of execution of
specialization, specialization strategy, proposal of specialization class and
applicability. After determining the right type of specialization we specialize selected
code fragments. The last part of specialization process is integration of original and
specialized code. One way how to make it is to put specialized methods into original
classes. The problem of this concept is to ensure security. Another approach is to
encapsulate specialized code into separated classes. Specialized methods from separate
class will not be able to access private or protected attributes of original class.
Integration can be also achieved using aspect-oriented programming. Specialization
code is separated in aspect and woven into original code in compile time. Thus we can
distinguish between original and specialized code and if we decide not to use
specialization we simply won't weave aspect code into original.
Object-Oriented Specialization Using Aspect Programming 135

4 Specialization using aspect programming


Aspect-oriented programming is an approach for realizing separation of concerns by
grouping them into logical units. In compilation process aspect code is first woven into
original by aspect weaver. Resulting code is then compiled by regular compiler.

4.1 Static approach

This concept simply adds new methods and attributes into existing code in compile
time (more precisely in weaving time). The place of addition is defined by pointcut
expression. Aspect programming uses term introduction. After specialized methods are
introduced into original program the client code invoking original code needs to be
changed. Change consists of replacing these calls with specialized ones.

4.2 Dynamic approach

This concept is rather different from the static one. It is based on dynamic activation of
advice code whenever specific code join point is reached. We can bind this advice code
to a code pointcut what in a case of specialization may represent virtual call. If we
want to replace call of original function we use an around section with specialized code
and omit a statement which calls it. Advantage of this approach is that after
specialization we don't need to change any client code. Aspect containing specialized
code is activated when relevant code join points are reached. Unfortunately this
approach has limited applicability in present time because AspectC++ produces some
overhead when invoking advice code. This overhead grows with number of parameters
that need to be passed to specialized methods and as my tests show it costs more than
the call to the virtual function. When this problem will be solved we can expect that
this type of specialization will be fully applicable.

5 Specialization example
Example consists of specialization of program using design pattern Decorator [1]. The
overhead in this case is coupled with method invocation on AComponent object. Client
is not aware of concrete type of object being hidden behind this abstract class. We are
able to eliminate virtual methods in fragments in which we can determine the concrete
type of the object the client is working with. For this purpose let us say that it is
CConcreteDecoratorA, which has CConcreteComponent as inner component.
136 Adrián Slavkovský

Fig. 1. Scheme of Decorator example

AComponent *comp = new CConcreteComponent();


//before specialization
AComponent *dec = getDecorator(comp);//get Decorator
result = dec->doSomething(a);
aspect Decor { //static specialization
pointcut spec() = "CConcreteDecoratorA";
advice spec() : long int doSpecSomething(int a) {
before();
CConcreteComponent* comp=(CConcreteComponent *)
this->getComp();
num = comp->doSomething(a);
after(); return num; }};
result = cDecA->doSpecSomething(); //specialized client

aspect Decor { //dynamic specialization


advice args(a) && call("% AComponent::doSomething(...)")
: around(int a) {
CConcreteDecoratorA *cDec = (CConcreteDecoratorA *)
tjp->target();
CConcreteComponent* comp = (CConcreteComponent*)
cDec->getComp();
cDec->before();
num = comp->doSomething(a);
cDec->after(); *tjp->result() = num; }};
Fig. 2. Decorator

In static approach we will introduce new specialized method into


CConcreteDecoratorA to ensure that it has access to all attributes and methods of
this class. In dynamic specialization we need to obtain a parameter of original function.
Then we get a reference to target of the call (we know the type of object) and reference
to its inner component.
Object-Oriented Specialization Using Aspect Programming 137

6 Results
Tests were made using ac++ 0.9 under Microsoft Visual C++ .NET in cooperation with
AspectC++ Add-In under two configurations – Debug mode and Release Mode (full
optimizing mode). Specialization using introduction accelerates program from 2 to
15%. Using dynamic concept we have observed slowdown of specialized program.
Because decorator contains the other component (which could be decorator as well)
specializing a method of such object can be done via recursive algorithm.
unfoldDecorator(AComponent *dec) {
if (dec is not component) {
dec->before(); //do before method
unfoldDecorator(dec->getComponent());
dec->after(); //do after method }
else return dec->doMethod(); }
To improve performance and eliminate excessive method invocation we can
provide references to component objects as parameters of specialized function and call
methods on these objects in function body respectively. The results are shown in tab. 1.

Tab. 1 Specialization results – Decorator


Compile %
Specialization description Function call
mode speedup
Debug method with parameter doSpecSomething(a) 1,2
method with parameter and
doSpecSomething(a,
Debug pointer to component of 4,9
pointer)
decorator
Debug method without parameter doSpecSomething() 5,1
method without parameter
Debug and with pointer to doSpecSomething(pointer) 11
component
Debug recursive decorator doSpecSomething() 15,3
Release method with parameter doSpecSomething(a) 0,9
method with parameter and
doSpecSomething(a,
Release pointer to component of 1,4
pointer)
decorator
Release method without parameter doSpecSomething() 1,6
method without parameter
Release and with pointer to doSpecSomething(pointer) 3
component
Release recursive decorator doSpecSomething() 5,9
Debug dynamic specialization -3,6
Release dynamic specialization -1.5

From these observations we can say that in present time the only applicable way
how to integrate specialized and original code with aspect programming is to use
138 Adrián Slavkovský

introduction which gives us promising results and speedups. In future there is a


possibility to use dynamic approach when related overhead produced by aspect will be
eliminated.

7 Conclusion
Object-oriented programming is dominating paradigm in developing commercial
applications. With aim of design patterns software becomes more generic, reusable,
modular and adaptable but leads also to performance expenses. These overheads can be
eliminated by specialization. This paper focuses on object-oriented specialization and
integration of original and specialized code using static and dynamic aspect approach.
The results of my observations show that static way accelerates program's execution.
The limitation of dynamic way lies in overhead internally caused by aspect language. If
these overheads shall be eliminated this approach could be more perspective.

Acknowledgement: This work has been partially supported by the Grant Agency of
Slovak Republic grant No.VG1/0162/03.

References
1. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns Elements of
Reusable Object-Oriented Software. Addison-Wesley, 1995. ISBN 0-201-63361-2
2. Masuhara, H., Kiczales, G.: Modeling crosscutting in aspect-oriented mechanisms.
In: Proceedings of ECOOP2003, LNCS 2743, Darmstadt, Germany (2003), 2-28.
3. Návrat, P., Filkorn, R.: A Note of the Role of Abstraction and Generality in
Software Development. Journal of Computer Science, Vol. 1, No. 1, Science
Publications (2005), 98-112.
4. Rashid, A., Blair, L.: Aspect-oriented Programming and Separation of Concerns.
In: Proceedings of the International Workshop, Lancaster University, UK (2001)
5. Schultz, U. P., Lawall, J. L., Consel, Ch.: Automatic Program Specialization for
Java. ACM Transactions on Programming Languages and Systems, Vol. 25, No. 4
(2003), 452-499.
6. Schultz, U. P.: Partial Evaluation for Class-Based Object-Oriented Languages. In:
Proceedings of the Second Symposium on Programs as Data Objects; Lecture
Notes In Computer Science, Vol. 2053 (2001), 173-197.
7. Schultz, U. P., Lawall, J. L., Consel, Ch.: Specialization Patterns. Rapport de
recherche 3853, 1999.
8. Slavkovský, A.: Specialization of design patterns using aspect-oriented
programming. In: Proceedings of ISIM '05, Czech Republic (2005)
9. Urban, M., Spinczyk, O.: AspectC++ Language Reference. Version 1.2, 2004.
http://www.aspectc.org
Exploring the Commonality in Feature
Modeling Notations
Miloslav ŠÍPKA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
miloslav.sipka@gmail.com

Abstract. Feature modeling is an important approach to capturing


commonalities and variabilities in system families and product lines.
This article analyzes the commonalities and variabilities among
different approaches to feature modeling with respect to their use in
order to determine how feasible is to unite their notations into a
consistent unit and support them in a single feature modeling CASE
tool. Suggested notation basis combines the extended Czarnecki-
Eisenecker notation (with UML like cardinalities) with Gurp-Bosh-
Svahnberg edge decorations and identifies mandatory parts of the
information associated with features.

1 Introduction
Feature modeling is the activity of modeling the common and the variable properties of
concepts and their interdependencies and organizing them into a coherent model
referred to as a feature model [1].
A feature model represents the common and the variable features of concept
instances and the dependencies between the variable features. Model represents the
intention of a concept, whereas the set of instances it describes is referred to as the
extension of the concept. A feature model consists of a feature diagrams and some
additional information such as short semantic description of each feature, rationale for
each feature, constraints, default dependency rules etc.
A feature diagram consists of a set of nodes, a set of directed edges, and a set of
edge decorations. The nodes and the edges form a tree. he edge decorations are drawn
as arcs connecting subsets or all of edges originating from the same node.


Supervisor: Ing. Valentino Vranić, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 139-144.


140 Miloslav Šípka

A mandatory feature is included in the description of a concept instance if and


only if its parent is included in the description of the concept. If the parent of a
mandatory feature is optional, the mandatory feature should not be part of the
description. A mandatory feature node is pointed to by a simple edge optionally ending
with a filled circle (Fig. 1 row 1).
An optional feature may be included in the description of a concept instance if the
parent is included. If the parent is not included, the optional feature cannot be included.
An optional feature node is pointed to by a simple edge ending with an empty circle
(Fig. 1 row 1).
A concept (and similarly a feature) may have one or more sets of direct
alternative features. If the parent of a set of alternative features is included, then
exactly one feature from this set of alternative features is included in the description,
otherwise none. The nodes of a set of alternative features are pointed to by edges
connected by an arc (Fig. 1 row 2).
A concept (and similarly a feature) may have one or more sets of direct or-
features. If the parent of a set of or-features is included in the description of a concept
instance, then any non-empty subset from the set of or-features is included in the
description, otherwise none. The nodes of a set of or-features are pointed to by edges
connected by a filled arc (Fig. 1 row 3).
Feature modeling helps us to avoid two serious problems: First, relevant features
and variation points are not included in the reusable software. Second, many features
and variation points are included but never used and thus cause unnecessary
complexity, development cost, and maintenance cost. Finally, the feature models
provide us with an abstract (since implementation independent), concise, and explicit
representation of the variability present in the software.

2 A Survey of Feature Modeling Notations


Today most accepted is Czarnecki-Eisenecker notation. Its main advantages are that
this notation is compatible with the original FODA notation while at the same time
bringing some new possibilities. In Fig. 1 the original FODA notation and both
Czarnecki-Eisenecker notations-the base and the extended one-are compared.
Exploring the Commonality in Feature Modeling Notations 141

Original FODA notation Czarnecki-Eisenecker Extended Czarnecki-


[4] notation Eisenecker [2]
mandatory and optional mandatory and optional mandatory and optional
subfeature subfeature subfeature
c c c

[1..1] [0..1]

f1 f2 f1 f2 f1 f2
alternative subfeatures XOR group group with cardinality <1-
c c 1>
c

<1-1>
f1 fn f1 fn
f1 fn
OR group group with cardinality <0-
k>
c c

<0-k>

f1 fn f1 fn
XOR group with optional group with cardinality <0-
subfeatures k>
c c

<0-1>

f1 fn f1 fn
Fig. 1. Comparison of feature modeling notations [2]

Another UML-based notation is the one used in FeatuRESB [3]. It explicitly deals
with variation points. It defines static and dynamic binding in a variation point. This
notation was overcome by Gurp-Bosch-Svahnberg notation [6] which has been
developed for expressing variability in software product lines. It brings OR and XOR
specialization into variation points. Initially, the binding type was not represented as
edge decorations, but this can be done using the flag at the feature. In Fig. 3, the two
mentioned UML-based notations are confronted with Czarnecki-Eisenecker notation.
142 Miloslav Šípka

Czarnecki-Eisenecker FeatuRESB [3] Variability in software


notation product [6]
XOR group Variation point feature, XOR generalization
c dynamic binding
c c

Load time
f1 f2
dynamic dynamic f1 f2 f1 f2
XOR group Variation point feature – XOR generalization
static binding
c c c

f1 f2 f1 f2 f1 f2
OR group OR generalization
c c

f1 f2 f1 f2
Fig. 2. Comparison of others feature modeling notations

2.1 Additional Information provided with features

First additional information provided with features is binding time and binding mode.
Binding time is important if we have to describe implementation details of feature and
code with references feature. So it is important to identify binding time of feature.
First of five binding time is source time. The decision to bind feature is made by
programmer or designer during the implementation phase. Other binding times are
compile and link time. In this case the feature is bound automatically by preprocessor
or special linker program. There is no reason to make difference between linking and
compile time. Some languages do not have linking at all. This three times represents
static binding.
Other two types of bounding represent dynamic bounding. It is load and rum time.
Feature with load time bounding is selected in instance of concept in time when the
program loads in to memory. Feature with run time bounding can be selected widely
when the program is running. In both cases we must implement feature and compile it.
Exploring the Commonality in Feature Modeling Notations 143

But in fact implementing other modules can be different if feature can change in run
time of the program.
Another additional information supported with feature is layer. FODA [4]
identifies four layers of features. There are Operating environment layer, Capability
layer, Domain technology and Implementation technique. But there can be need of
more than four layers of features. So categorization of features in layers is not so
important and is used very rarely.
One important categorization is to identify if feature represents abstract (identical
as a abstract class in OOP) thing or have to be implemented and integrated as a part of
code.
Other additional information provided with features and feature model in general
are constraints and default dependency rules. Constraints represent necessary
conditions each instance of concept have to fulfill. Default dependency rules represent
rules of choosing default feature while creating instance of a concept. In FODA the
constraints are reduced to simple rules representing the so-called requires and mutual
exclusion relationships between features. A more sophisticated way of representing
constrains is to use predicate logic [5].

2.2 Common parts of feature diagram notation

After comparing several notations we can extract the common parts. Czarnecki-
Eisenecker notation can act as a backbone for this. The reason is simple: each of the
analyzed notations extends this notation. Original Czarnecki-Eisenecker notation will
be improved in two ways. The first is extending by cardinalities as it is in Fig. 1. The
second way is to identify relationship between a feature and its subfeature as in Fig. 2.

2.3 Common parts of associated information

It seems there are lot of information associated with features and feature diagram. If
fact it is impossible to choose set of information for common notation. The best way is
let user to choose witch associated information he need. In this case it is important to
let user choose what associated information will be displayed in a feature diagram and
how. Truly common parts of associated information are constrains and default
dependency rules. One effective way to express constraints is predicate logic [5].

3 Conclusions
In our survey we compare six notations of feature model. We discover that there are no
collisions between these notations. Concerning feature diagram, each notation
introduces different quantum of information in diagram. At one side, information
contained in diagram doesn’t have to be included as additional information. At other
side feature diagram can be difficult to read. Concerning additional information, we
found that each notation provides other type of information.
144 Miloslav Šípka

Further work includes developing of a metamodel that contains all described


notation elements. After that implementing a support tool which will use this
metamodel. So it allows user to choose how to express relations between features,
either in diagram or as associated information.

Acknowledgement: This work has been partially supported by the Grant Agency of
Slovak Republic grant No.VG1/0162/03.

References
1. Czarnecki, K. Eisenecker, U.W.: Generative Programming: Principles, Techniques
and Tools. Addison-Wesley, 2000.
2. Czarnecki, K. Helsen, S. Eisenecker, U.W.: Staged Configuration Using Feature
Models. In: SPLC 2004, LNCS 3154, R.L. Nord (Ed.), 2004, 266–283.
3. Giss, M. L. Favaro, J. d'Alessandro, M.: Integrating Feature Modeling with the
RSEB. In: Proc. of 5th International Conference on Software Reuse, Vicoria, B.C.,
Canada. IEEE Computer Society Press (1998),
http://www.favaro.net/john/home/publications/rseb.pdf
4. Kang, K.C., Cohen, S.G., Hess, J.A., Novak, W.E., Peterson, A.S.: Feature-
oriented domain analysis (FODA): A feasibility study. Technical Report
CMU/SEI-90-TR-21, Software Engineering Institute, Carnegie Mellon University,
Pittsburgh, USA, November 1990.
5. Vranić, V.: Multi-Paradigm Design with Feature Modeling. PhD thesis, Slovak
University of Technology in Bratislava, 2004.
6. Group, J., Bosh, J., Svahnberg, M.: On the Notion of Variability in Software
Product Lines. In: Proceedings of WICSA 2001 (2001),
http://www.jillesvangurp.com/publications/notionOfVariability.pdf.
Automatic Backup in Oracle Database
Miloš SÝKORA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
msykora@gmail.com

Abstract. One of the Database Administrator’s (DBA) most important


responsibilities is to keep the database available for use. To protect the
data from all types of failures that can occur, the DBA must make
regular backup of the database. In this paper I concentrate on the
“logical” backup and cold (or offline) backup (database in
NOARCHIVE LOG mode). Final product (set of scripts) will do the
“logical” and cold backup of the Oracle database with selected
frequency and send a log-file with results by e-mail to Database
Administrator automatically.

1 Introduction
Without a backup it is impossible for the DBA to get a database up and running, if
there is a file loss, without loosing data. Backups are critical for recovering from
different types of failures.
Backup and recovery strategy depend on the type of company. For example I
choose software Development Company, which needs the logical backup and cold
(offline) backup of the testing database.

2 Backup scripts

2.1 Backup and Recovery strategy

The nature of backups and recovery strategy is always affected by the type of business
operations. In this case, I want to select proper backup and recovery strategy for the
small Development Company.

Supervisor: prof. Ing. Vladimír Vojtek, PhD., Institute of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 145-149.


146 Miloš Sýkora

2.2 Cold (offline) backup

Database can be configured in Archivelog Mode, so that a history of the redo


information is maintained in archived files, allowing for a complete recovery up to the
point of failure. This option is suitable for situation where a database must be available
24 hours a day, 7 days a week for continuous option.

Fig. 1. Backup Methods

Development Company does not need this solution. Therefore, the database is
configured in noarchivelog mode. The main feature of running database in
noarchivelog mode is that the redo log files are used in a circular fashion. DBA may
perform only operating system backups of the database when the database is shut
down. During each backup must DBA backup the entire set of data files, redo log files
and control files. In the case of failure DBA must recover these files from an earlier
copy of a full database (offline backup).
A closed database (cold) backup is an operating system backup of all data files,
control files, redo log files, parameter files, and the password file that constitute an
Oracle database.
I define an operating system backup procedure that will always back up all
necessary files as part of a strategy to safeguard against potential media failures that
can damage files. It is a simple script that shut down the database, copies the data files,
and opens the database. Then another script sends log file with results by e-mail to
DBA. For a Development Company I select to perform cold backup twice a month.
Automatic Backup in Oracle Database 147

Fig. 2. Closed Database Backup

Performing a closed database backup:

1. define local variables (ORACLE_HOME, ORACLE_SID¸


DFILE)
2. connect to database
3. start spooling in log file
4. select start date
5. shutdown database
6. copy and pack all necessary files
7. startup database
8. select end date
9. stop spooling
10. send log file via e-mail to DBA

2.3 Logical backup

Logical backup provides Oracle Export and Import Utility. Export utility provides a
logical backup of database objects or an entire database. The import utility is used to
read a valid Export file for moving data into database.
For a Development Company I choose everyday logical backup in Full database
mode. This mode exports all objects, except those in SYS schema.
148 Miloš Sýkora

Fig. 3. Logical backup in Full database mode

Performing a logical backup:


1. define local variables (ORACLE_HOME, ORACLE_SID¸
DFILE, DATEF)
2. create directory for actual month (if necessary)
3. backup in Full database mode
4. pack Export file
5. send log file via e-mail to DBA

2.4 E-mail notification

In previous sections I describe how to make backups. It is important to know for each
DBA what the result of these scripts was. The easiest way is send an e-mail with the
log file of screen output.
Sending mails from operating system depends on platform. Because of this, DBA
needs to implement the functionality of sending email directly from the Oracle
database. Oracle has an e-mail server option that allows programmer to send mail from
within his code. In the case, users can send e-mails to competent persons when a
critical parameter is altered, when a database has some issues (for DBAs), or when a
backup is over and so on.
For e-mails without attachment UTL_SMTP and UTL_TCP packages are
required. UTL_SMTP is designed for sending e-mail over Simple Mail Transfer
Protocol (SMTP). The UTL_TCP package provides TCP/IP client-side access
functionality in PL/SQL.
Automatic Backup in Oracle Database 149

In this case DBA need to attach log files. When DBA sends email using Java
Stored Procedures (JSP) and the Sun Microsystems JavaMail package, attachments can
also be sent.
Performing mail notification:

1. Create the mail user


2. Grant appropriate role privileges to the mail user
3. Grant java permissions
4. Create java source

2.5 Installation

The DBA have to ensure the complete path names of the files are noted and used
appropriately in backup. In a multiple database environment, care must be taken to
associate these files with the corresponding database through some naming convention,
since the names of the parameter files and password files are not recorded in the
database dictionary.
Location of backup scripts depends on operating system platform. UNIX cron
jobs can be scheduled with the crontab command. Windows can schedule any
application using the Windows Scheduler.

3 Conclusions
The primary goal of these backup scripts is to relieve the DBA from backup routine.
Only what he has to do is check his e-mails, and makes appropriate action (copy
backup files to tape, etc).

References
1. Schwinn, U., Venkatachalam, V.: Oracle8: Database Administration, Vol 1,
(March 1998)
2. DiIanmi, J., Raman, S., Robson, P.: Oracle8: Backup and Recovery Workshop, Vol
1 (October 1998)
Modeling Systems Using Design Patterns
Jaroslav JAKUBÍK ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
jakubik@fiit.stuba.sk

Abstract. The possibility of the re-use of the design patterns brings


into patterns more than it might seem. We use design patterns in
method named “pure design patterns phase”. In described method we
seek to take advantage of design patterns composition for complex
solution of closer problems. We modified standard software
development process with use of special phase, which by using design
patterns as elementary modeling unit purport to describe majority of
solution. In this paper we describe basic notation for model in this
phase. Based on example with patterns Composite and Iterator we
define general relation between any two patterns.

1 Motivation
Current phases of software development process are fairly delimitated and defined
except for some experimental projects. To find the exact limits between phases is
becoming harder and harder, however. After business processes were defined and
requirements were concretized, there was a place for analysts and designers to create a
model of reality. In this phase, there is a need for narrow communication about
modeled problems between analysts and designers.
Designers need to zoom in reality described in the analysis. Based on the analysis,
the designers need to define the design model. It is very important to remove all
communication differences between the analysts and the designers as well as those
between designers themselves.
We want to be able to create a communication bridge between analysts and
designers to define a terminological glossary, basic modeling units etc. We create a
model in which analysts can find their required functionality and which offers
designers view the realization of the defined functionality. There are several resources


Supervisor: doc. Ing. Jana Minárová, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 151-158.


152 Jaroslav Jakubík

how to attain this bridge. In this method the concept of design patterns according to
catalogue [1] is used.
By the described method, we want to refine differences between the analysis and
the design to quickly come to an agreement between the analysts and the designers
concerning the design model.

2 Introduction to problem
Analysts know “what” and designers know “how”. There is a need to join these two
views together into one model where analysts can see which part of the system is able
to provide a required functionality and designers can have an apparent method how this
model can be transform into a design.
For this context we use older concept of design patterns. In each catalogue of
design patterns, a lot of patterns described with various UML diagrams, examples and
recommendations of use can be found. We can process this additional information and
get a list of functionality which using of each design pattern brings.
From an analyst’s point of view, we have design pattern functionalities. On the
other side, from the point of view of a designer, we have a way to implement a current
pattern, entire view of a design and an implementation of the application, a way in
which an application will be expandable in future and a lot of information from many
experts in the domain of object oriented software development.

3 Related works
There exist a lot of theories about design patterns composition. The main idea of these
theories is that pattern glue with another (or the same) pattern together solves largest
scope of problems. Whereas majority of publication concentrate on composing design
patterns on class level such as [6] and that argue by various mathematical theories, we
want to look on composition of design patterns on view of their functionality. We
enable analysts and designers to speak the same language, which lighten and simplify
mutual understanding.
Concept of modeling with pure design patterns was used in [7, 8]. Authors based
on publication of Alexander [9] defined two ways of composing design patterns.
Straight modeling was distributed to two phases. In the first phase “Analysis” analysts
list all related patterns. In second phase “high level design” designers keep patterns
selected by analytics to three models “Pattern-Level Model”, “Pattern-Level with
Interfaces” and “Detailed Pattern-Level model”. In each model designer explore new
details of pattern and application domain. The last model can be transformed directly to
class diagram.
This method is very similar like our approach but it is concerned on special group
of patterns named “constructional patterns”. Authors in thesis don’t define any
relations between patterns.
There are many notations of saving metainformation about design patterns in
concrete design. There are two mainly ways of these notations. First way is to extend
Modeling Systems Using Design Patterns 153

UML with resource exactly to extend UML for example UML Collaboration Notation
[3], Stereotype annotation [4], Tagged Pattern Annotation [2]. Second way is to define
visualization of design pattern in class diagrams for example Venn Diagram-Style
Pattern Annotation [5], Dotted Bounding Pattern Annotation [4], Pattern: Role
Annotation [5].
Basic modeling units in all of these notations are class, method or attribute in
dependence of concrete notation. For our using there are all notations too detailed and
didn’t defined relations and their notations on pattern level.

4 Pure design patterns phase


We define phase of software development process which fall into analysis and into
design too. We named this phase as pure design patterns phase. In this phase we will
not speak about classes and relations between them but we will speak about design
patterns and relations between patterns.
We create model in which we used only design patterns. Analysts know
functionality of each pattern so they can create list of patterns which cover required
functionality. Designers, based on other view of analysis and personal know-how, can
define other patterns which can be added to analysts patterns for covering other
problems. We have got a group of patterns which cover part of required functionality.
The bigger is part covered with patterns the fewer problems in next phase of design.
We used skills of other experts for support or fully ensure required functionality.

4.1 Relations between design patterns

In following progress of pure design patterns phase based on analysts and designers is
a need to define relationships between patterns. In general we can separate
relationships to two groups:
1. general relationships - include relations between any of patterns except special
cases
2. concrete relationships - is assigned to a enumerated group of patterns, where
each pattern has its own role in relation
Now, for express relation between two patterns we used continuous line, which
says nothing about concrete relation between patterns and neither about role of pattern
(or class as a part of pattern) in relation.
We can conceive pattern as a subsystem which insure defined and known
functionality. With this generalization we have got model, which consist of group of
patterns expressed with subsystems and elementary relations between patterns
expressed with continuous line.
154 Jaroslav Jakubík

Fig. 1: Model of simple graphics editor in pure design patterns phase

Now we can say that based on this model we came near from analysis to design as
far as to implementation. This model doesn’t represent material for definitive
transformation from model of pure design patterns to concrete design. General
relations between design patterns can be interpreted in different concept.
We don’t want go in this way. When we created model in pure design patterns
phase with sufficient metainformation it must be definitive transformation and
interpretation of this model to class diagram.
In comparison with elementary relationship there is a need to have concrete
definition of relations between patterns.

4.2 Example of defining relation between patterns

As example of defining relation between patterns we define general relation based on


principle of defining design patterns.
In this process of definition we came out of our experiences of using patterns
Composite and Iterator. Based on example of concrete relation we attempt to define
general relation.
Class Composite in design pattern Composite must wrap services of Container
such as getting and iterating through elements from composite. With continuous
iterating through elements of composite can class Composite use Iterator pattern. Class
Composite of pattern Composite is in role of Client in Iterator pattern. This relation on
class level is render on figure 2.

Fig. 2: Join of design patterns Composite and Iterator through Client class
in Iterator pattern on class layer
Modeling Systems Using Design Patterns 155

We informally define concrete relation between Composite and Iterator pattern.


We split generalization of this concrete relation to two phases.
In first phase we generalize pattern Composite to pattern A, which uses services
of container or iterating through elements of container. Pattern A is in role of Client in
pattern Iterator. For example we use pattern Iterator with pattern Interpreter according
to figure 3.

Fig. 3: Join of design patterns Interpreter and Iterator through Client class
in Iterator pattern on class layer

Based on first generalization we know how to use any pattern with pattern Iterator
(if it is necessary). The next step in process of generalization is to generalize pattern
Iterator to pattern B. Now we can compose any patterns by role of client. For example,
rendered in figure 4, class Leaf from Composite pattern can be client in Strategy
pattern. Class Leaf from Composite pattern is in role of Client in Strategy pattern.
Let’s name this relationship as follows: pattern A with class A1 used pattern B.

Fig. 4: Relationship “pattern A with class A1 uses pattern B” explained on pattern


Composite with class Leaf uses pattern Strategy on class layer
156 Jaroslav Jakubík

We have got whole definition of relation between two patterns, but how can we
write information about relationship to pure design patterns model? We need notation
for writing relation to model. What kind of information we need to know for transform
defined relation to class diagram? In this occurrence answer is very simple. We need to
know pattern A and pattern B, which are connected with relation, and class A1 which
is in Client role of pattern B.
The last problem of definition process is graphical formulation of defined
relation. We use current notation of UML and pattern express as subsystems as we
defined before.

Fig. 5: Notation of relationship “pattern A with class A1 uses pattern B”

We express relation “pattern A with class A1 uses pattern B” as a continuous line


ended with arrow in pattern B. We must now reflect necessary metainformation in
model. In this case it’s only class A1. We inscribe class A1, which is Client in pattern
B, above continuous line expressed relation near pattern A. Example of this notation is
on figure 5.

4.3 Verification

The suggested approach into the software development and modeling has not been
verified in a commercial project, yet. This approach was used in two smaller
experimental projects but in these cases, the exactly defined relationships were not
used. We used patterns Iterator, Composite, Adapter, Strategy, Builder and Singleton
to reach the required functionality.
The phase of pure design patterns was used in the development of both systems.
Our phase has brought former comprehension of the design problems by analysts and
vice versa the comprehension of analytical requests by designers.
The statement cannot be generalized about all projects but the phase of pure
designed patterns seems to quicken the process of understanding the requests, reduce
the communication gap between analysts and designers and facilitate the partial
automation of transition from an analytical model into a designed one. This can
happen mostly in case that the phase of pure designed patterns is exactly defined and it
additionally includes other rules.

5 Future work
This work brings a new view on the concept of the design patterns. However, this
brings a lot of problems that have to be solved before the final use of this method in
commercial projects. Firstly, a large variety of relationships among patterns is
Modeling Systems Using Design Patterns 157

necessary to be defined. The definition is requested to be eloquent and concrete enough


mainly for the necessity of unambiguous transformation of the model of pure designed
patterns into the class diagram. While defining the relationships, it is possible to follow
the mentioned example.
Secondly, a lot of relationships demand an exact and expandable definition of
notation. Due to this definition, the essential data can be properly displayed or hidden
in a particular moment.
We are conscious of the fact that the defined method of the approach to the
software development is only experimentally proved on few models and that the
attempt to define this phase into the projects in progress and backwards creating the
models of existing systems is essential. This approach to verification of our method
seems to be the best alternative in confirming or refuting of the conclusions of the
defined procedure.

6 Conclusion
The proposed method tries to utilize as much as possible from the wide potential of
patterns. Furthermore, at the basis of the requested functionality, a model is being
created only by using designed patterns. This covers irrelevant details in the phase of
analysis and an initial design and on the other side it displays the essential details for
the transformation in the later design.
In comparison with POAD method from [7] and [8] our method in using design
patterns join both approaches in composing design patterns whether directly by gluing
patterns together to “stringing patterns” or with use of new defined relationships for
creating “overloaded patterns”. The main idea of our method is very similar like idea
of POAD method. Both approaches have some equivalent phases like analysis, in
which analysts define list of patterns to cover requested functionality, and phase of
design refinement, which comes after transformation of pure design patterns model to
class diagram. Our approach unlike POAD method defines only one model in
difference of three models in POAD. Each refinement creating in models of POAD is
substitute by using strictly defined relationships between patterns.
The mentioned approach to the software development or transition from an
analysis to a design based on the defined phase appears to be the appropriate
alternative to the traditional approach. This issue is not being sufficient for the
purposes of the real use. However, the missing relationships among patterns should be
defined upon the work experience of either commercial or experimental projects.

Acknowledgement: This work has been partially supported by the Grant Agency of
Slovak Republic grant No. VG1/0162/03.

References
1. Gamma, E. et al.: Design Patterns, Elements of Reusable Object-Oriented
Software. Addison-Wesley Publishing Company, 1995, ISBN 0-201-63361-2.
158 Jaroslav Jakubík

2. Dong, J.: Representing the Applications and Compositions of Design Patterns in


UML. In: Symposium on Applied Computing, 2003, pp. 1092-1098.
3. Object Management Group: Unified Modeling Language Specification. Version
1.4, 2001, http://www.omg.org.
4. Dong, J.: UML Extensions for Design Pattern Compositions. In: Journal of Object
Technology, Vol. 1, No. 5 (2002), 151-163.
5. Vlissides, J.: Notation, Notation, Notation. In: C++ Report, Vol. 10 (April 1998),
48-51.
6. McC. Smith, J., Stotts, D.: Elemental Design Patterns: A Formal Semantics for
Composition of OO Software Architecture. In: Software Engineering Workshop,
2002. Proceedings. 27th Annual NASA Goodard/IEEE, pp. 183-190.
7. Yacoub, S. M., Ammar, H. H.: Pattern-Oriented Analysis and Design (POAD):
A Structural Composition Approach to Glue Design Patterns. In: Technology of
Object-Oriented Languages and Systems, 2000, pp. 273.
8. Yacoub, S. M., Ammar, H. H.: UML Support for Designing Software Systems as a
Composition of Design Patterns. In: UML 2001 – The Unified Modeling Language,
Modeling Languages, Concepts, and Tools, 2001, pp. 149 – 165.
9. Alexander, C. et al.: A pattern language. Towns, Buildings, Construction. Oxford
University Press, New York, 1977, ISBN 0-19-501919-9.
On the Composability of
Concurrent Systems
Matej KOŠÍK∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
kosik@fiit.stuba.sk

Abstract. Traditional sequential computation has a number of


advantages, among other things, simple composability. That is, we can
easily compose more complex things from smaller ones. The Internet,
however, cannot be viewed as a sequential computer. Its natural
concurrency must always be somehow heeded. We present a
computational model which has a number of advantages over the
ones, to which we were used to. The computation in the proposed
computational model is inherently parallel and thus better reflects the
nature of the Internet. It is, nonetheless, significantly different from
the classical parallel programming environments. The programmer
does not have to deal with the threats of interference and dead-locks
explicitly. The programming paradigm, we present, naturally leads
away from them.

1 Introduction
Concerning the programming of personal computer, different programming languages
and environments were hitherto created. We have number of interesting options to
choose from. There are various classes of languages, there are various levels of
abstractions. These programming environments enable us to explain the computer how
to represent, store and manipulate the information of our interest. When we are
proficient in some programming environment, we can deal with most kind of locally
stored information without problems.
There are, however, situation when two or more processes need to share the same
data. That data might be on the same or on a remote computer. There we have various


Supervisor: prof. Ing. Jiří Šafařík, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 159-166.


160 Matej Košík

bad options to choose from. None of them fits to the language we are using. Many
programmers wouldn't ever notice this problem because the language they use is so
inconsistent, that another inconsistency doesn't change anything. Those of us, however,
who use some consistent language will suffer.
Databases more or less provide the functionality we need. They enable us to have
shared, concurrently accessed and persistent data. So what is wrong with databases?
They do not enable us to do what we need to do. We want to create open systems. We
would love to have a possibility to create vivid, interacting and communicating
information systems. We need similar platform for distributed computing as was
provided by Smalltalk in the area of personal computing. The impacts of such a
wonderful computation platform, if it existed, would be immense. It would at least free
us, Smalltalkers, from the prison of a local image. The wise have already realized the
properties and implications of open systems long time before [1]. We need open
systems. It is the way to explicitly cooperating information systems, e-business, e-
government etc. The personal computing is covered by vast number of various
programming languages. Concerning open systems, there seems to be none. We think
that it is not because there is no need for such a platform. It is so, because of the nature
of the problems in this area which are far more complex than with which the
programmer has to deal with when creating a single isolated sequential program.
The first problem which attracted our interest is the problem of finding proper
computational model for expressing all the computation we need. In personal
computing, we had Smalltalk. A single, powerful, consistent and general-purpose
language. As it was realized earlier [1], open-systems will be composed from diverse,
concurrent, asynchronous subsystems.

2 Coarse-Grained Parallel Programming


Its introduction was a logical step. When we realized that it would be for some reasons
advantageous or necessary to perform some computation in parallel with another
computation, we have taken our well-established sequential languages, enriched with a
possibility to create parallel processes, some means of their communication and
necessary synchronization. It may sound as a cliché, but classical parallel programming
is much harder than sequential one [3]. Not only we have new problems to deal with
(such as the threat of interference and the threat of deadlock). But the appearance of
these problems is non-deterministic. That is, given an initial state of a program, it may–
but need not to wind up in a deadlock. That is a difference from developing sequential
program.
When sequential program is not correct then it is incorrect deterministically. That
is: given an initial state, it converges into bad state always. That is a big advantage,
because when we spot problems, they are reproducible. Therefore sooner or later we
can track them down.
It is interesting to note the problems with which we must deal with, significantly
depend on the programming abstractions we use. Composition of parallel processes in
the paradigm of pipes and filters is far easier. We could view processes as components
On the Composability of Concurrent Systems 161

and pipes as glue which binds them together. The primitive functionalities could be
composed to the larger whole in many different ways. We can start with simple
functionalities and by composing them together we can gradually add the complexity.
This approach is an example of composable programming paradigm. The composition
we speak about is easy. Imagine that you have two processes and you interconnect
them with a pipe. The effort required for understanding the whole is the sum of the
efforts required for understanding the parts plus some constant which does not depend
on the complexity of the parts.

3 Fine-Grained Parallel Programming


This section sketches the basic philosophy. As it was already mentioned, we have
implemented a virtual machine, which forms a living space for active objects. The
virtual machine mediates the interaction of the actors which live in it. This architecture
is nothing new. The environment–the world–is dynamic. New active objects are
created and unnecessary actors are garbage-collected. The environment is also parallel,
because each of that, actors can be viewed as an independent threat of control. Active
objects do have a state. This state is represented by their references to other actors. An
active object may over the time change its state. That is, the references it holds may be
redirected to point to different objects. Each active object is associated with a set of
methods with the similar purpose as in classical object-oriented programming. This
defines a mapping from selectors (message names) to methods (concrete code). When
an active object receives a message (in our system it is called mail) then according to
the selector of this message, appropriate method of the object is invoked. As a result of
a method invocation, receiver (the actor which received a mail) may send other
messages to the actors it knows–its acquaintances. We would like to stress that the
mails, we speak about, are sent asynchronously, therefore when an active object sends
a mail, it doesn’t wait at the result. It immediately continues with the next statement.
When it is the last statement of the method it is executing, then it looks into its mailbox
if there are any yet unprocessed messages. If yes, it fetches the first of them and
continues with processing. For these reasons, the system is inherently parallel. Such a
systems were already proposed long time ago [4]. The problem is that when we do not
invent the language and the applied policy of message delivery properly, we will not be
able to take advantage of that environment. If we enforce sufficiently wrong policy,
then programming such a system will be impossible. That is the case of the most
policies. Our previous experiment [8] is an example of such a wild (almost no) policy
of mail delivery. When we devise, on the other hand, too strong policy, the resulting
system will not be able to take advantage of the parallel nature of the Internet. That is
the case of the RPC (Remote Procedure Call), RMI (Remote Method Invocation) and
similar technologies.
So, the question is if it is possible to devise such a policy of inter-actor
communication, which will be inherently parallel–hopefully without the need from the
programmer to specify parallelism explicitly. And also such policy must be usable. It
should be devised in such a way that we can express the things we need to do as easily
162 Matej Košík

as we are able to do them in sequential programming without slipping into the


sequential programming.

4 The Object-Model
We have had to make some decisions how to organize actors. The object model
enables the actor to store its state–there are attribute slots. It also enables the actor to
store its behavior and thus specify its reactions to the mails it receives–there are
method slots. Attribute slots and methods slots has names. They enable us to recognize
between the particular attributes and methods similarly as it in normal object-oriented
languages. Value of an attribute slot is a reference to a mailbox. Value of a method is a
block-context. More detailed information about the organization of actors can be found
in [5].

5 Primitive Actors
Some values cannot be expressed as a composition of other values. Integers are
example of such kind of values. If our system didn’t contain integers, the programmer
wouldn’t be able to implement them himself. Therefore our system, similarly as it is in
Smalltalk, provides the programmer with all the necessary primitive actors he needs to
build its own actors. Integers are also actors although their implementation might be in
some respect obscure. Nonetheless, the programmer can treat them as any other actors.
No other primitive actors were implemented because anything else can be represented
by composition of integers. Numbers of floating point, for example, can be represented
as a couple of integers where the first integer actor is a mantissa and the second one is
an exponent. Or, if we would like, we could introduce a second kind of primitive
actors–floats–to take advantage of the floating-point support which is provided directly
by the underlying hardware, if we wanted.
One of the primary expressions is an integer expression. The programmer can
utilize a literals to denote a particular integer actor. That is convenient. We could
implement also a support of other literals such as characters or strings. They, however,
need not to be mapped to primitive types as it is in case of integers, but perhaps into
derived actors, i.e. those ones, whose implementation is based on primitive actors or
on other derived actors.
The other kind of primitive actors we couldn’t avoid to implement is so called
block-context actor. They are somewhat similar to the blocks in Smalltalk or to
lambda-expressions in LISP. They represent a deferred computation. These block-
contexts can be invoked at run-time. When they receive a predefined message with
selector called value, their body is executed. Their execution may require additional
parameters and these are also given at run-time. The body of each method is also
represented as one block-context. The block-contexts are useful because if we have
them, we can express branching and iteration by passing mails. We need not introduce
special purpose language constructs. All we need is passing mails. This language is
really beautiful because it is built from a small number of powerful concepts.
On the Composability of Concurrent Systems 163

6 Mailbox
The capabilities in our system are of two kinds. There is a slit capability and there is
also a mailbox capability. As it was already mentioned, the attributes store the mailbox
capability–they refer to some mailbox. The mailbox capability gives its holder a
possibility to create a slit at the end of the mailbox. The slit capability, on the other
hand, makes it possible for the holder to either create a new slit before a given slit
which is held or to insert a message before a slit which is held. Note that in this way it
is possible to operate only on those parts of the mailbox to which we have capabilities.
One activity may be operating on the beginning, other on the middle and another
unrelated activity perhaps on the end. The mailbox is a total ordering of the slits and
mailboxes which belong to that mailbox. The mailboxes play the crucial role in the
synchronization rules enforced by the programming environment. When a programmer
utilizes a slit to send a mail, the slit not only determines the mailbox (and therefore also
the actor) to which a given mail will be inserted. Because mailbox is total ordering of
items it contains and because of the enforced rules on the operation which can be done
with mailbox and its items, the slit determines also the state of the receiver actor on
which the sender of that mail can count on. If for example the sender reveals some
state of another actor, then thanks to the capabilities it holds, it can utilize these
capabilities to act appropriately without the threat of interference. No other actor can
jump into and interfere. Other actors operate on other part of the actor in question. This
is the vital property of our system.
The programmer does not operate on the mailboxes and slits explicitly. What is to
be done with the capabilities he holds is expressed in the code indirectly,
comprehensively and conveniently. The manipulation of the capabilities drove the
design of the semantics of the language.
The actors live in parallel with each other. That is, they could process the
messages contained in their mailbox, to which they listen to, concurrently. Sometimes
some actor needs a result computed by a method of some different actor and he wants
to use this result in the method. In sequential programming we did not have any
problem because the result of the computation appeared on the stack of the process.
The elegant solution of this problem in the Actors paradigm was proposed number of
years in the past by the fathers of the Actors paradigm [4]. They have proposed the
abstractions called future. The future is, as we understand it in our system, a mailbox
which does not belong to any actor, i.e. no actor listens to it, no actor fetches mails
from it. This future, however, enables its creator to pre-post the mails to the not yet
computed result, to whose mailbox this future will be included, once the result is
established. This enables the creator of the future to proceed with computation even
though some things were not yet computed. It sends those mails to the not yet
computed result which it has to send and does not care about when and who will
process them. The support of futures is built into the language, their creation is
automatic.
164 Matej Košík

Fig. 1. An example of a mailbox. There are slits and mails inside it. More about the
mailbox, slits and messages can be found in [5].

7 Methods
Methods specify the behavior of an actor when it receives a mail with a selector under
which a given method is stored in the actor. Each method, when compiled from the
source code into “machine code“, is internally stored as a sequence of commands. We
have a language in which the activity can be specified conveniently. That language has
a syntax very similar to the syntax of Smalltalk. The semantics of the sentences written
in this language is, however, very different. The compiler turns a textual source code
into internal representation. Each block is internally represented as a sequence of
commands. There are two kind of commands. We have a mail-sending command and
primitive command. Mail-sending command simply denotes a mail which has to be
sent when that command is executed. Most of the commands in the system are exactly
of this type. Each mail-sending command holds three different pieces of information: a
mailbox capability, a selector and slit capabilities (the parameters of that mail). The
mailbox capability makes it possible to include the future in the place (before proper
slit) of a mailbox which was computed to be the result of the invoked method.

8 Primitive Statements
Primitive statements are here to implement such actions, which cannot be further
decomposed into mail-sending. The system itself contains only a limited number of
these primitive commands and they are usually wrapped in some methods. The
programmer himself will not use these primitives directly. There is also finite set of
primitives sprinkled throughout the system in appropriate methods of appropriate
classes. Most of the commands are message-passing commands.
Actions such as addition, subtraction of integers, cloning of an actor, or doing
nothing (but including a given future to our mailbox) are so primitive, that they cannot
be further expressed by sending other mails and relying on the functionality of simpler
methods.

9 Composability
We are confident about the general-purpose usability of the proposed programming
environment. It seems to be able to handle all the problems and with the same ease,
which were able to do in Smalltalk. The computation is performed differently, the
language we have proposed has different semantics, the proposed computational
environment could take advantage of the parallel nature of the Internet (whereas
On the Composability of Concurrent Systems 165

Smalltalk couldn’t. Or better to say, Smalltalk could take advantage of the Internet and
do parallel programming as badly as it is possible in any other sequential programming
environment.) We are not confident whether the proposed programming can be ranked
among composable environment (to which Smalltalk and any other normal sequential
programming environment certainly belong.) The classical parallel programming
environment based on sequential communicating processes are not composable. This
property is best exhibited when something goes wrong in the whole system. In
sequential system, when it has proper architecture, the time to locate the problem is log
N where N is number of all elements in the system. You start from the root of the
functionality tree and end in some of the leafs (primitive actions). The system itself
may be composed of huge number of elements, but the path from the root of the tree to
any of its leaves is relatively short.
That is not the case of the classical parallel systems. There, everything effects
everything else. It could be compared to the sequential programming with GOTO
statement. If sequential programming were done with direct jumping into some other
functionality, adding of new elements to the system would be hard because you would
need to re-think the whole system (who could jump into the newly added elements and
to which other elements newly added should jump). You need to reconsider the whole
every time it is enriched with new elements. That makes this development method
suitable only for small problems. It was replaced by the procedural programming.
When the programmers learned these new notions, they were suddenly capable to
produce sequential systems of yet unseen. Now it might seem weird, but there were
times when the implementors of the programming languages took care to implement
procedure calls effectively enough in order not to demotivate the users of those
compilers (us, programmers) to use procedures instead of wild goto statements [6].
Parallel-programming expressed as coarse-grained sequential communicating
processes is like sequential programming with the GOTO statement. It can be done
only in small scale and the result is inflexible. Just look around how many sequential
programmers do you know and how many parallel programmers do you know. There is
so few of them because doing parallel programming is not for normal people. It is so
because we do not have proper abstractions.

10 The Scope of Our Work


Wouldn’t it be wonderful if we were able to write scripts which manipulate remote
objects safely, lively and securely? The security is addressed by the people working on
the E project [2,7]. The purpose of the V2 prototype is to prove or to disprove the good
properties (composability) of the proposed computational model. Its implementation is
in progress and as soon as we make it work, we will see whether the proposed
abstractions are usable or not. We would like to point out high degree of parallelism in
our system. We would like to show that the threat of interference of parallel activities
is in our computational model automatically excluded (thanks to the policy of the
operations which we can do with the capabilities–the slit and the mailbox). We would
like to show that when deadlock happens in our system then it happens
166 Matej Košík

deterministically and perhaps also propose its automatic resolution. We would like to
show on examples demonstrating the way how parallel activities can operate on the
shared object known to all of them. We would like to exhibit the composability. That
is, when we have a whole composed of parts, then detection of malfunction is
logarithmic function of the number of the elements from which the whole is composed
of. As it was the case in the procedural-programming and object-oriented programming
with passive objects.

11 Conclusions
We have got the idea about the advantage of total ordering of mails sent to a single
actor in May 2004. This idea gradually matured and soon it will be examined. In the
meantime we realized the importance of the security [2] and ways how to deal with it.
We are very far from the final solution. Lot of the problems (load-balancing, security,
distributed garbage-collection, distributed persistence) are not yet solved and their
solution seems to be conflicting. Also, maybe it is possible to solve each of them in
isolation but it is questionable whether it is possible to combine those solutions
together. But that is beyond our current horizon.

Acknowledgement: This work has been partially supported by the Grant Agency of
Slovak Republic grant No. VG1/0162/03.

References
1. Hewitt, C.: Offices are open systems. ACM Transactions on Information Systems,
Vol. 4, No. 3 (1986), 271-287.
2. Stiegler, M.: A PictureBook of Secure Cooperation. Hewlett-Packard, 2005.
http://www.skyhunter.com/marcs/SecurityPictureBook.ppt
3. Andrews, G. R.: Concurrent Programming. Principles and Practice. The Benjamin/
Comings Publishing Company, Inc., 1991.
4. Agha, G.: Concurrent Object-Oriented Programming. Communications of the
ACM, Vol. 33, No. 9 (1990), 125-141.
5. Košík. M.: V2. 2005. http://altair.dcs.elf.stuba.sk/~kosik/V2.pdf
6. Hoare, C.A.R.: The Emperor's Old Clothes.
http://www.braithwaite-lee.com/opinions/p75-hoare.pdf
7. Miller, M.: E, Open-Source Distributed Capabilities. http://www.erights.org
8. Košík, M.: Programming Constructs in Actors Computational Model. Faculty of
Informatics and Information Technology. Slovak University of Technology in
Bratislava, May 2004. http://altair.dcs.elf.stuba.sk/~kosik/V1.pdf
Extensional and Intensional Semantics
of pUML Objects
Miroslav LÍŠKA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovak republic
miroslav_liska@formal-analysis.com

Abstract. Language UML (Unified Modeling Language) brought new


generation into specification, realization and documentation of
information systems and thanks to its open architecture it becomes as
standard. Naturally, there have come different kinds of lacks, where
the most important is probably the fact, that the semantic is defined
using natural language. This finally results in many imperfections, for
example ambiguity in understanding written models. As a fail-back
from this situation we can use language pUML(PreciseUML), where
this language is well formed defined using mathematical language Z.
Purpose of this document is not only to present more precisely defined
language pUML, but also use analytical philosophy to improve
software specification process.

1 Introduction
Software specification is necessary but not sufficient condition for developing proper
solution. Even final system is without errors, does it really realize customer
requirements?
Software specificators use many different techniques to create specification.
Specifications are written in natural or in artificial language. These artificial languages
can be formal or semiformal. Formal language architecture is specified in precise way,
i.e. well-formed architecture, i.e. syntax mapped into semantics using mathematical
language. When the language is not defined formally, but its architecture maps syntax
into semantic weakly using natural language, we can call this language as semiformal
(e.g. UML).


Supervisor: doc. Ing. Jana Minárová, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 167-174.


168 Miroslav Líška

2 Formal language
Language in common implies that syntax is mapped into semantic domain, where the
meaning of syntactic elements is, strictly speaking, just those mapping functions.
Syntax in common is semiotic discipline which studies symbols, language elements,
without pointing on theirs meaning. The simple word, in syntactic point of view, has n
elements, has some grammatical properties. But the meaning is not important. What is
very important and also interesting property of syntax is proofness [1].
Semantics, on the contrary, primary studies the meaning of words (i.e. meaning of
syntactic elements). But the question is, how can be used this in software development
process?
The goal of this article is to use mathematical and analytical philosophy
techniques in PUML for respond to previous question. Firstly it is necessary to specify
mathematical language and its properties as theories, proofness, formulas, language
realizations, correctness, completeness [2].

The most common mathematical languages are based on predicate logic. Syntax
of this language consist of infinite many symbols for variables, logical symbols,
functional symbols, predicate symbols, symbols for quantifiers and additional symbols.
Syntax of language also defines formal system for this language. Formal system
contains axioms, proofness, theorems [2].
Semantics of this predicate language studies thruthness of syntactic formulas.
Formula is not proposition in common, what results that is not possible say, if the
formula is true or false. For example, let’s define predicate P as property of some
element to be positive integer. Then the formula

∀x ∈ X : F ( x) (1)

is true if X={1,5,100} and on the contrary, formula is false if X={-1,2,3}.


Truthness of formula depends on containment of set X and also in specification of
predicates. More generally, semantics studies the language realization LR
(interpretation), where this is formally represented as relational structure LR=(M, Fr,
Pr), where M is sets of individuals, Fm is set witch represents realization of all
functional symbols on M, and finally Pr is set which represents realization of all
predicate symbols on M. Sumarly language has its own specification and realization.
Theorems of correctness and completeness are used to study this relationship. Firstly
let’s briefly define what is of theory and what model theory is. Theory T is defined
through axioms so any theorem of this theory is probable using correct proof .If exists
relational structure LR, where is truth every axiom of theory T, we can call this as
model of theory T, defined as LR |= T.

If T is theory with language L and if A is formula of language A where T |- A,


then T |=A. Every theorem of T is truth in every models of this theory. In general, this
theorem is called as theorem of correctness.
Extensional and Intensional Semantics of pUML Objects 169

If T is theory with language L. Then if is true that if A is arbitrary formula of


language, then
(i) T |- A <=> T |= A. Naturally, we can say that A is theorem
of T if, and only if is A true in every models of theory T.
(ii) T is antidisputative (disputative is when formula a ∧ ¬a is true), if
T has some model

3 Correctness between specification and realization


When the software development process is model driven, it brings possibility to
implement correctness and completeness. Analysis in model driven development is
representing by analytical models, typically use case models, logical model. Then in
design discipline are designed other models, typically different use case realizations.
The proper relations between these two types of models are necessary condition for
right software system. But what is the proper relation between specification and
realization in common? This is the place, where correctness and completeness comes.
The goal of specification (use case model) is to determine, what system should do and
goal of realization is how it can be done. Analysts create as a matter of fact theory, and
then designer creates model of theory, in mathematical point of view. Correctness
between specification and realization can be used, but usually it is not always the rule.
There are many questions about implementing correctness and completeness, or other
mathematical properties, e.g. proofness. How to prove, that the realization really fits its
specification?
I think the answer was partially observed. Usability of these techniques in
software development process is limited by architecture of language. Does the
language enable axioms, proofness, theory etc.? If yes, facility of correctness and
completeness can be used, if not, final correctness will be very controversial [3].

4 UML imperfections
Many articles about this topic were written. Before I will continue also with this trend,
I would like to say few words about UML perfections. Language UML is standard
modeling notation in software development domain. UML did great progress into
software systems development. Concept of use cases (e.g.) is very powerful and
interesting, what finally brought new generation into specification, realization and
documentation of software systems. In today’s world, there are many great software
technologies as Microst.NET, Java, Oracle, Lotus etc. But only the technology can’t
alone bring the right solution, even the technology has brilliant, modern architecture.
There must be some abstract research discipline, to enable fully use these power, e.g.
through correctness. And finally UML brought irreversible step toward here. What
a great step.
But even UML improve this positively, there are still too many lacks, what
language UML after all also brought. The main imperfection of UML is lack of
precision in its well-formned architecture, i.e. weakly defined semantics.
170 Miroslav Líška

UML Semantic is described using meta-model that is presented in terms of three


views: abstract syntax, well-formned rules, and modeling element semantics [4]. The
abstract syntax is expressed using class diagrams and natural language, well-formed
rules are expressed using Object Constraint Language and finally semantics of model
elements are described in natural language, too.

Fig. 1. Abstract syntax of use case

The previous image depicts abstract syntax of use case diagram from UML 2
Superstructure specification. The well formed rules and semantics is written in natural
language. What is wrong with this access? Syntax and semantics are written in
different languages (class metamodel and natural language) but what is more
important, semantics is defined from precision point of view very controversially, what
can results in endless discussion, which semantics is proper and which is not. Syntax of
UML doesn’t have also build-in calculus for proofness. And also, the lacks of weakly
defined semantics finally implies the fact, that UML can’t use theorems of correctness
and completeness between specification and realization (i.e. between theories and
model of theories).
The existence of this fact is simple. Specifications written in UML are more
understandable as in math, and it doesn’t requires knowledge of formal methods.
Extensional and Intensional Semantics of pUML Objects 171

5 Precise UML
PUML is an international group of researchers and practitioners who share the goal of
developing UML as precise (formal) modeling language. PUML is written in Z, where
this language is precise language in mathematical point view, it is based on predicate
logic [5]. It enables every concept of precise defined language as theory, model of
theories, proofness, correctness, completeness … etc. Let’s give simple example of
PUML, where the semantic of classifier will be show. Note this example is only
shortening preview of classifier specification. A classifier has a name, and a set of
attributes:

Abstract syntax is then defined as set of classifiers. For exact definitions please
refer to [2]. In order to give meaning to classifiers, values must be assigned. PUML
interpretation of UML object is then:

5.1 PUML semantics

PUML semantics is specified as mapping between syntax and semantics domain in


precise way, what is the main difference between PUML and UML. Note that syntax
and semantic is written using Z, what is mathematical language based on predicate
logic. The meaning of classifier is then:
172 Miroslav Líška

The previous schema describes meaning of classifier. In specification part of


schema, there is exactly defined that semantics of classifier if realized through
mapping classifier into object. The second (i.e. predicate) part of schema defined
semantics constraints of meaning in mathematical way, and therefore is semantics
expressed in clear, precise way. This definition implies also, when syntax will be true
in semantics domain. PUML is enable define relational structure language realization
LR, where we can define, what must be done, to obtain true formula in realization. It is
clearly expressed when specification (i.e. theory) is true in its realization (i.e. model of
theory).

6 Analytical philosophy in specification


The method of Analytical philosophy generalizes approach to philosophy. Originally
associated with project of logical analysis, it nowadays emphasizes a clear, precise
approach with particular weight being placed upon argumentation and evidence,
avoidance of ambiguity, and attention to detail. The aim of the analytic approach is to
clarify philosophical problems by examining and clarifying language used to express
them.

6.1 Intension and extension in natural language

Intension refers to the meanings or characteristics encompassed by a given word. It can


be understood as a word's connotation. Intension is often discussed with regard to
extension. Extension refers to the class of things to which the word can be applied. In a
simpler sense, the intension of a word can be thought of as the collections of
associations the word creates in the mind of someone using or hearing it, while
extension (or denotation) refers directly to the referent or referents that the word
describes.
Extensional and Intensional Semantics of pUML Objects 173

Sentences John is great student and John wrote great research paper have
evidently different syntax. The first two sentences are the same extensions of word
John, because they simply talk about John. But they also want to refer, that John is
great student and also John wrote great research paper. So these sentences are
different intensions of the word John also [6].

6.2 Intension and extension in PUML

Usability of intension and extension in software development process has ability to


widespread. Note, when you write mathematical formula, it is important to say, that it
represents extensional view of specification. This is because formula says, that every
element x from X has the same property F(x). So every elements of set X are the same
extensions of F(x). Let’s imagine that analyst needs to specify some possible
states of some objects in system. He probably use case model for functionality and
class diagram as conceptual model (i.e. dynamic and static representation of
requirements). But he also can specify extensional and intensional view of
specification. In intesional view we represent state intentions and their initializations.
A state intension comprises class attributes and a class invariant. An initialization
makes an assignment of values to class attributes. The example of intensional view of
object Copy (i.e. borrowed book) can be:

In extensional view class state extension defines the set of all existing class
objects, and a mapping between objects atoms and their state intentions:

Now is necessary to ensure correctness between specification and realization.


Note that correctness can be established between any two different model or view of
models. This finally implies usability of proofness and refinement of specifications
174 Miroslav Líška

(e.g. Z/EVES tool). Analyst could write theorems based on its specification and to
verify them to improve his specification.

7 Conclusions
Question is how it can be usefully implemented in development process? It is to
difficult imagine, that software analysts will write their specification only using formal
methods in real, big commerce projects. But in near future, we can’t exclude
application of this method for some complex part of theirs specification. On the other
hand, actual usability’s of formal methods are applied in improving model
infrastructures (e.g. UML), and also in enhancement of proofness capability in case
tools.

Acknowledgement: This work has been partially supported by the Grant Agency of
Slovak Republic grant No. VG1/ 0162/03.

References
1. Amálio, N., Stepney, S., Polack, F.: Formal Proof from UML models, Department
of Computer Science, University of York.
2. Cmorej, P.: An Introduction into logical syntax and semantics.
3. Evans, A., France, R., Lano, K., Rumpe, B.: The UML as formal modeling
notation, Computer Standarts & Interfaces, 1998.
4. OMG: Unified Modelling Language 2: Superstructure, Final adopted version, 03-
08-02
5. Spivey, J.M.: The Z Notation: A reference manual. Prentice Hall, Englewood
Cliffs, NJ, Second Edition, 1992.
6. Peregrin, J.: An Introduction into theoretical semantics, Masaryk University of
Brno, 1994.
Using UML with OCL as ADL
Matúš NAVARČIK∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
navarcik@fiit.stuba.sk

Abstract. Architecture description languages (ADLs) are specialized


formal languages supporting modeling and reasoning on software
architectures. Although the number of ADLs counts in the tens, their
popularity and usage by practitioners is very low. Unified modeling
language (UML) is de facto industrial standard, however not fully
qualified ADL. Accompanying UML with Object Constraint
Language can be adapted as ADL. The paper tries to provide such
mapping of UML + OCL to ADL.

1 Introduction
Recent decade highlighted the problem of large-scale systems in context of their
analysis, design, integration, modification and so forth. Consequently, the notion of
software architecture is in the focus of software engineering research. The research in
software architectures started by identifying architecture patterns which has been
adapted to architectural styles. Contemporarily, a lot of effort has been provided to
formalization and specification. Formalizing architectures can lead to their strong
acceptance by industrial practitioners and hence even industrial but just academic
usage of knowledge of software architectures can be applied.
Software architecture formalization has been embodied by formal languages for
architecture specification or description, commonly called Architecture Description
Languages (ADLs). However, as well as there is no common single definition of
software architecture, there is no consensus upon what an ADL is. A lot of studies have
been appearing to introduce, improve ADLs, many works have tried to identify the
common features of ADLs to conclude the definition.
Along with software architecture research the industry enforced appearance of
common language for modeling during analysis and design phases. Resulting Unified


Supervisor: prof. Ing. Pavol Návrat, PhD., Institute of Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 175-182.


176 Matúš Navačik

Modeling Language (UML) has matured to formal language with graphical notation
and nowadays, UML is de facto industrial standard in software engineering.
Within this paper, we would like to briefly summarize current considerations on
ADLs and provided overview on recent approximations of UML to ADL. Anyway,
omitting Object Constraint Language (OCL) as integral part of UML degrades UML
far away from ADLs.
The paper is organized as follows. Section 2 introduces ADLs and tries to
uncover distinction between ADLs and other languages; section 3 discusses UML as
language capable to describe and model software architecture; section 4 deals with
UML embedded OCL as powerful tool for modeling of and reasoning on software
architectures emphasizing profiling UML; and finally, section 5 concludes the paper.

2 ADL
[1] defines Architecture Description Language (ADL) as “a language (graphical,
textual, or both) for describing a software system in terms of its architectural elements
and the relationship among them”.
In other words, ADL is a languages enabling formalization, description,
specification, modeling and reasoning on software architectures. Each of these features
should be fulfilled by language that is proclaimed to be ADL.
The number of languages generally considered ADLs is about 20. [11] introduces
15 of them. To the list belong languages as Wright, ACME, C2 and others. These
languages differ in features, possibilities, and mathematical background, however.

2.1 Distinguishing ADL

As there is no general taxonomy of ADL features, research branch trying to


distinguish ADL from other languages appeared. [7] introduces revised framework to
classify and compare current ADLs. Consequently, the framework summarizes all
generally expected and required features of ADLs. ADL must be capable to model and
reason on basic architectural entities:
• components and their interfaces
• connectors
• architectural configurations
These entities are the core notions of software architectures. To fully support
these “the musts”, ADL shall provide their further modeling in types, semantics,
constraints, evolution support, non-functional properties. The most interesting part of
architectural entities lies in configurations: configuration is the key to system
consistency checking, audit, dynamics control, integration, error-free systems, and so
forth.
Using UML with OCL as ADL 177

3 UML
Unified Modeling Language (UML) [10] is formal graphical language considered a de
facto industrial standard. Although the language has been created as graphical language
firstly to support object-oriented software analysis and design, the language has been
revised couple times and today, it is a general formal language capable to describe
a software system The UML has well defined formal syntax and semantics and can be
machine checked and processed.

3.1 UML 2.0 architectural features

UML 2.0 enriched support to modeling architectural issues of the software system.
Among the most important features count enriched interfaces, ports, refined
components and connectors.
Interfaces can be fully defined in a protocol statements and interface state
variables. The explicit distinguish between provided and required interfaces avail.
However, one must count on three different ways to capture interface in UML.
Consequently, the assembly element appeared as a handshake of required and provided
interfaces.
Port is a new concept to UML. It is very close to interface but that each port is
a distinct interaction point of its classifier. Anyway, port may have interfaces defined.
Components and connectors can provide internal viewing with embedding even
another internal components and connectors. Hence one can model lower system
structures as appear in real solutions: as there is no clear difference in among
component and e.g. classes, the hierarchical composition of system in modeling should
be included.

3.2 UML and software architecture

The significance of UML as wide spread language supported by industry has been
attracting research attention for a long time ([3], [5], and [1]). However, plain UML
has never been identified strong enough to be considered ADL. The position of plain
UML is fairly the position of documenting language.
Anyway, [3] discussed 5 possible strategies in using UML for architecture
description. Basically, they supposed the architecture described by types and their
instances. The strategies of architecture transcription are summarized in Tab. 1.
178 Matúš Navačik

Tab. 1. Strategies in architecture description by UML (adopted from [3])

types instances using diagram notes


notation
classes Objects class diagram the most intuitive OO mapping
stereotypes Classes class diagram stereotyping
classes Classes class diagram homogenous view
stereotypes components component the ADL approximation
diagram
subsystem/p packages component or
ackages deployment
diagram

The most important strategy is using a component diagram. Anyway, stereotyping


suggested as solution for types brings some non-trivial problems to UML. Alone
standing UML does not provides a formal technique for stereotype definition. This
problem has been identified at the creation of UML and since early versions of UML, it
is accompanied by OCL.
Omitting formalization brings problems to semantics of graphical notation. Let us
refer to Fig. 1 giving an example of interpreter architecture. The most important
problem is usage of arrows: they should bring additional information to the reader.
However, using arrows in associations is strongly intended to be about navigability in
the model. Hence there is no general semantics on responsibilities, time dependencies
or data flow. By [10]: “An association specifies a semantic relationship that can occur
between typed instances”. Consequently, any attempt to use hidden semantics hidden
in connectors slightly represented by associations is misusing UML but prior formal
definition.
Note that provided example is syntactically correct diagram (the proper word of
formal language UML).
Using UML with OCL as ADL 179

Interpreter

DataInputReader SimulationEngine DataOutputWriter

ProgramStateMachine Activ ationRecordMachine

ProgramReader

Fig. 1. Interpreter architecture described in UML 1.4

Anyway, ambiguity of arrows can be partially limited using recent version of


UML and its features dealing with components. The example of simple pipes-and-
filters systems is depicted in Fig. 2. The major distinction between the models in Fig. 2
and Fig. 1 lies in using assembly element between components exposing their explicit
ports. Still, the model does not show any data flow behind; but the semantics of
connectors is clear.
System

«Filter» Source
Sink Grep

Sink1
«Pipe» «Pipe»
«Filter» Source1 «Filter»
Splitter MergeAndSort

Source2 «Pipe» Sink2

Fig. 2. Simple pipes-and-filters styled system using UML 2.0

4 UML embedded with OCL


Object Constraint Language (OCL) [9] is a formal language based on Metaobject
Facility (MOF), which is an OMG model for accessing UML model structure, first-
order logic and set theory. OCL is integral part of UML. However, the most industrial
UML tools still does not support OCL more than allowing putting down a text.
180 Matúš Navačik

Although the language is suggested for constraint specification, it can be


successfully used in many other cases. The [8] demonstrates its usage as formal
language in proving on object structures.
The most often way of usage is defining constraints of the modeled system.
Embedding OCL provides extra syntactical and semantic limitations making the model
clearer and more complicated, however. Anyway, language usage is obviously
advantageous for clarifying model.
Consequently, OCL is a way of definition of stereotypes. Stereotype is a new
class of metamodel, effectively ([10]). This means that stereotypes enlarge the number
of elements usable in the model, on the other hand provide specific limitations and
specialize elements in a semantics and syntax. By [10], “Generally a stereotype
represents a usage distinction”. Stereotypes are the key notion of UML built-in
extension mechanism.

4.1 Profiling UML

[6] suggested profiling based on OCL defined stereotypes to map particular ADLs to
UML. This approach seems to be very promising. UML profile is a set of elements,
usually focused on particular business domain. Creating a profile does not influence
the language
Bellow an OCL definition of stereotype WrightGlue suggested by [6]. The
stereotype defines a glue element of Wright ADL.
self.stateMachine -> size = 1 and self.stateMachine ->
forAll(sm | sm.stereotype = WrightStateMachine)

However, simple profile of an ADL as the Wright counts to tens of stereotypes


and final usage of the profile by practitioners can be both bothering and tedious.

4.2 UML + OCL = ADL?

This is the principal question. Although the UML embedded OCL provides all features
expected from ADL, we tend to answer rather no, as well as software architecture
community still does. The problem that appears is the fact, that UML + OCL >> ADL.
The concepts of UML are clear, can be fully refined to conform to the most of ADLs.
Using OCL, even non trivial reasoning on the system is available. However,
considering UML as ADL narrows the capabilities of the language. And consequently,
UML is tending to be used improperly as ADL. The best practice should be gained by
using specialized UML profile, possibly profile mapping particular ADL to UML.
On the other hand, UML must be considered as an alternative to ADLs when
modeling and reasoning on software architectures. UML is fairly the industrial
description language No. 1 for software architectures.
Using UML with OCL as ADL 181

5 Conclusions
UML is widely accepted language by practitioners. UML is capable to describe and
model even software architectures. The most promising way of mapping software
architectures to UML is using profiles on UML such that those profiles are derived as
mappings of ADLs. This approach leads to fully sound modeling language capable to
cover all requirements on ADLs. Recent versions of UML, in addition, reduce the
problem area of profiles. UML 2.0 has introduced some new concepts and refined
some other in a way that UML 2.0 is now almost software architectures conformant.
Embedding UML with OCL allows further reasoning on architectures. OCL
armed language shall be able to capture even dynamical aspects of the architecture.
Enabling this, the UML overtakes the most of ADLs.
However, UML is not a fair ADL. UML is capable to follow modeling of other
levels of detail, allows modeler to deal with tasks far away from ADLs. This great
power rooted in generality of the UML is the reason for exempting UML from ADLs.
The UML has no mechanisms to prevent user from misusing concepts. This can not be
avoided by simple profile. This is a mater of using UML.

Acknowledgement: The work reported here was partially supported by Slovak


Scientific Agency, Grant No. VG 1/0162/03.

References
1. Clements, P. et al.: Documenting Software Architectures. Views and beyond.
Addison-Wesley, Boston, MA, USA, 2002.
2. Garlan, D., Kompanek, A. J.: Reconciling the Needs of Architectural Description
with Object-Modeling Notations. In: Proc. of the 3rd Intl. Conf. on the Unified
Modeling Language - «UML» 2000. York, UK (2000)
3. Garlan, D., Monroe, R. T., Ivers, Wile, D.: ACME: Architectural Description of
Component-Based Systems. In: Foundations of Component-Based Systems.
Cambridge University Press (2000), 47-68.
4. Garlan, D.: Software Architecture. In: Encyclopedia of Software Engineering. John
Wiley & Sons, Inc., USA, 2002.
5. Ivers, J., et. al.: Documenting Component and Connector Views with UML 2.0.
Technical report CMU/SEI/2004-TR-008, ESC-TR-2004-008. Carnegie Mellone,
SEI, 2004. http://www.sei.cmu.edu/pub/documents/04.reports/pdf/04tr008.pdf
6. Medvidovic, N. et. al.: Modeling Software Architectures in the Unified Modeling
Language. ACM Transactions on Software Engineering and Methodology, Vol. 11,
No. 1 (2002), 2-57.
7. Medvidovic, N., Taylor, R. N.: A Classification and Comparison Framework for
Software Architecture Description Languages. ACM Transactions on Software
Engineering and Methodology, Vol. 26, No. 1 (2000)
8. Navarčik, M., Polášek, I.: Object Model Notation. To appear in: Proc. of 8th Intl.
Conf. ISIM’05. Marq, Ostrava, Czech rep. (2005)
182 Matúš Navačik

9. Object Management Group: UML 2.0 OCL Specification. OMG adopted


specification ptc/03-10-14. 2003. http://www.omg.org/docs/ptc/03-10-14.pdf
10. Object Management Group: UML 2.0. Superstructure Specification: Final Adopted
Specification. 2003. http://www.omg.org/ /docs/ptc/03-08-02.pdf
11. Software Engineering Institute of Carnegie Mellon: Architecture Description
Languages. April 2005. http://www.sei.cmu.edu/architecture/adl.html
Design and Prototype Implementation of an
Evolutionary Environment for Concurrent
Object-Oriented Programming
Ján ŽIAK∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
ziakjan@fiit.stuba.sk

Abstract. Simplicity and extensibility are important aspects of any


programming environment because they aid clarity and long-term
evolution. While in most programming languages the development of
programmatic constructs stops after the language is designed, the
central idea to this article is to start with a simple model of concurrent
programming with no constructs and with the possibility to add them
later as they are needed or invented. New constructs are created by
implementing them as objects. The programmer then takes advantage
of an object-oriented user interface which enables to write programs
by direct insertion of constructs into the code.

1 Introduction
Programming in any language involves the usage of constructs. Each of these
constructs, like for example iteration, message send, conditional execution or
expression evaluation, have their own syntax and semantics. The knowledge of the
semantics, which has usually nothing in common with the syntax, enables the
programmer to express his or her thoughts. The knowledge of syntax, on the other
hand, is an essential requirement for the ability to write down the thoughts already
expressed in the semantics of the particular programming language. The syntax of a
construct departs from its semantics in the sense that the syntax of the construct can be
chosen almost at will, the only mandatory constraint being the existence of some kind
of separate places or slots for the arguments of the construct. Thus, syntax of a


Supervisor: doc. Ing. Martin Šperka, PhD., Institute of Applied Informatics, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 183-191.


184 Ján Žiak

construct plays a role equivalent to a symbol here, which has the consequence that
there exists a magnitude of programming languages with almost identical constructs
from a semantic point of view but which are being typed in numerous different ways
[1]. Although this article is not meant to reconcile this problem, it seems rational that if
programming languages were designed in a way that allows to change the look of their
constructs and to seamlessly add new constructs into the language as they are needed
or invented, there would exist at least a hope for the different syntaxes with the same
semantics to converge into (ideally) one nice syntactic element so that competition
between different languages becomes to be based on the ability of the language to
express thoughts and to be less based on the ability to learn the subtle differences in
syntaxes with the same meaning. This however does not mean that there would be no
competition on the syntactic level.
An extensible programming language can have an advantage over a language
defined by a fixed set of grammatical rules because it can respond more rapidly to
changes. For example, a new syntax for an already existing construct could be tested to
see how it performs and feels in respect to the already existing syntax and adopted if it
performs well. New constructs (that is: new semantic elements) could be added to the
language to extend its capabilities so that a change does not require to design a
completely new programming language but only to extend an already existing one.
As evolution proceeds by creating new entities which replace some of the already
existing ones not fit enough to survive, it is necessary that a programming language
capable of evolution has the ability to get rid of constructs which are considered
inferior. However, the present state of affairs in the style of development of new
programming languages and of modification of existing ones makes this idea almost
insane because almost all programming languages take for granted to retain all of their
existing constructs if they are to be modified.
The next section introduces a model of concurrent object-based computation
which is then in section 3 used as a basis for building new constructs. Section 4 gives a
short overview of the graphical user interface allowing the user to program by direct
insertion of objects, some of which are programmatic constructs, into program's code.
The next section discusses the implementation of new constructs in Java and shows
example constructs. This is followed by a comparison of programming in our
environment with other approaches to extensible programming.

2 A model of concurrent object-oriented programming


The approach used in this article to design an evolutionary programming language is to
start with a sufficiently general and minimalistic abstract model of computation. The
basic presumption is that it is a concurrent object-oriented computation where objects
communicate by messages. One object can process at most one message at a time. The
response to received messages is determined by rules. The list of rules of an object
specifies its behavior. Each object has its own behavior and its own state (fig. 1),
although typically a single behavior would be shared between different objects of the
same kind. The basic inspiration for the model came from Self and the Actors model of
computation [3, 4].
Design and Prototype Implementation of an Evolutionary Environment... 185

Fig. 1. Structure of an object

The notion of a rule is similar to the notion of a rule of a Turing machine [2] or of
a production system [8] - the only difference is that at most one rule gets executed per
received message. Each rule has a condition-part and an action-part which executes
only if the condition-part is satisfied. The rules are examined in the order in which they
are listed and the examination stops when a rule with a satisfied condition-part is
found.
The condition-part is a list of conditions which are checked (in the order in which
they are listed) whether they are satisfied in the current context of object's state and
received message. The condition-part can be empty in which case it is treated as being
always satisfied. The action-part is a list of actions which are sequentially executed in
the listed order. The customization points of the programming language are the
conditions and the actions.
Object's state consists of a boolean value indicating whether the object currently
processes a message. Because it is expected that many programming constructs will
use variables, the state also contains structures for global and local variables. The local
variables are ordered into a stack of frames each holding variable values for a rule.
Object's global variables have the ability to survive over time while local variables
cease to exist after message processing finishes.
As there already exist numerous programming languages, the model is not
implemented from scratch but is designed and implemented in an already existing
language and environment, namely Java. The design of classes in Java is based on the
specification given in previous paragraphs. For example, a message sent
asynchronously from one object to another is an instance of a Java class. A message
186 Ján Žiak

can be any object of the implementation language, although it is typically a list of Java-
objects. Object's response to a message is based on the analysis of the content of this
message.
By default, messages sent to the object performing the send (i.e. to itself) are
processed synchronously. This is similar to a method call in ordinary object-oriented
programming languages. It should be noted that it impossible to known in advance
whether an object is sending a message to itself or not. An object could receive a
reference to itself in some message, store it in a variable and try to send a message to
this received object. It is ensured that this always results into a synchronous message
processing. This uses the stack of local variable frames to store information about
values of variables when a rule is calling another rule.

3 Extending the model with new constructs


In the beginning, the programmer is allowed to specify the condition-part of rules as a
list of message sends evaluating to a boolean value. Likewise, action-parts of rules are
lists of message sends. Thus, the only available programming construct is a message
send. While this can be considered to be general enough to specify any kind of
computation, it is more like programming in an assembly language rather than in a
higher-level one. Such a language lacks the constructs to express assignment of values
to variables, iteration or conditional execution, and lacks the constructs for specifying
patterns for categorization of incoming messages (i.e. selectors).
The graphical user interface shortly described in the next section allows one to
directly add references to objects into the graphical representation of rules. These can
refer to any kind of object of the implementation language. The basic idea is to
implement new constructs in the implementation language, instantiate them and
directly insert these instances into the right place in a rule.
The syntax of the constructs is specified by their graphical appearance and can be
arbitrary within the rendering capabilities of the graphical interface. The constructs
have no textual representation which makes pointless to speak of them as having a
grammar. As mentioned in introduction, each construct has to contain some kind of
separate places or slots where to put its arguments. For example, an "if-then" construct
contains two slots: one for the condition and one for the statements to execute in case
the condition is satisfied. The positions of these slots are part of construct's appearance
within the graphical interface.
The semantics of a construct is implemented in the implementation language (i.e.
Java) and is obtained from the object inserted into rule. The phase in which the
semantics of constructs are being obtained is called compilation. During this phase, the
construct typically checks for errors in its definition. The compilation omits syntactic
analysis because the syntax of the constructs, that is their appearance, has a meaning
only in respect to the programmer and is completely ignored by the compilation which
works with Java-objects implementing a particular known protocol. It is in fact
impossible for a syntax error to occur during compilation because there is no syntax to
work with. (This does not apply to message sends which do require some parsing.)
Design and Prototype Implementation of an Evolutionary Environment... 187

The semantics of a construct is an instance of a class of the implementation


language and conforms to a specific interface. The interface contains a single method
execute which is responsible for performing the semantics of the construct when the
object which contains a rule with this construct receives a message. The execution
method is passed a reference to the Java-object representing the object on which behalf
the execution is being performed. The method can use this reference to access object's
state and behavior, and change them according to its semantics. For example, the
semantics of the construct "assignment to a variable" is to replace the value of the
given variable in the global or local variable frame by its new value.
As the model of computation is a concurrent one, one cannot know when the
semantics of the construct finishes execution. For example, when the semantics entails
waiting for a value which is the result of some computation on some other computer in
the internet, the other objects cannot be blocked until this result is obtained. This issue
is resolved by passing a continuation to the implementor of construct's semantics.
When the execution of the semantics finishes, the continuation is used to report when
the next construct enlisted in the condition-part or action-part of the rule can start to be
executed. This mechanism allows to process messages sent to other objects while an
object is waiting for an event to take place, enabling the concurrent model of
computation to work on uniprocessor architectures.

4 Graphical user interface for manipulation with objects


Unfortunately, the graphical user interface used to perform programming cannot be
discussed here in its full detail because it is to complex. Only principles relevant to
programming will be considered here therefore.
Objects in the environment are represented by their visual appearance on the
screen of a computer. The interface provides means to display the appearance of an
object. Objects typically embed other objects. More precisely, the interface works with
references to objects rather than directly with objects themselves and allows to grab a
reference to a graphical object and to embed it into another object. It also allows to
work with non-graphical objects by representing them as graphical objects.
The rules, condition-parts, action-parts and syntax of constructs are graphical
objects. Rule is a composition of its condition-part and its action-part, each of which is
a list of constructs and text. The syntax of a construct can be made to look like
anything. For example, it would not be impossible to implement a construct which
would look like a blue jumping ball. However, the syntax of a construct is typically a
composition of some non-modifiable text and places where to put appropriate sub-
constructs. The syntax of a construct is not influenced by other constructs in any way,
which has the unpleasant consequence that there exists a possibility for two construct's
with different semantics to look exactly identical.
The environment departs from a typical contemporary integrated development
environment in substantial ways. It was inspired mainly by Squeak's [9] Morphic, but
provides better support for direct manipulation with objects and should discourage the
user from using text to express his or her ideas.
188 Ján Žiak

It should be noted that the idea of extensible programming presented in this article
would have been impossible without the existence of this graphical environment for
manipulation with objects.

5 Implementation and examples


The whole system together with the user interface is implemented in the Java
programming language taking advantage of the existing infrastructure of its runtime
environment and some additional libraries. However, the model of concurrent
computation has been implemented from scratch because the rate of switching between
threads was to coarse-grained, while the system requires a fine-grained level of
parallelism.
The design of classes is based on the description of the computational model in
section 2 of this article. Constructs which are to extend the language with new features
implement a special interface containing a method transforming the construct into its
compiled form. The compiled form, which can be an expression or a statement, is an
object and conforms to an interface with an execute method which is invoked to
perform the semantics of the construct in the context of a particular object. The
difference between a statement and an expression is that the former does not by default
return a value, while the latter does.
An results which are the products of some computation are communicated by
means of sending messages. The typical pattern of returning a value which is the result
of an expression evaluation is resolved by having a slot-object which accepts the result
and then notifies any objects waiting for the result.
The implementation allows replace the behavior of any object by another
behavior at any time. Likewise, the rules of a behavior can be dynamically added or
removed. Thus, the environment is designed to be as much dynamic as possible. The
consequence of this is a slow execution speed.

Fig. 2. Two example rules

Figure 2 shows two sample rules. The condition-part is in the top and action-part
in the bottom. Variables are in bold, syntax of constructs is in italics, words in regular
style designate message parts and the boxed text represents a symbol for a Java-class.
Design and Prototype Implementation of an Evolutionary Environment... 189

The first rule in the figure uses these constructs: message send, evaluation
whether a variable is a global variable, declaration of a global variable, assignment,
expressions which evaluates to the received message and reference to the receiver, and
finally a send operation. The semantics of the rule says that its action-part is executed
when variable state is not a global variable. The actions declare two variables as
global (i.e. „static“), perform two assignments and then send the just-received message
to the object itself for further processing.
The second rule is simple in its actions which just perform two message sends. Its
condition part contains construct called a selector which is able to determine whether
the received message looks like the specified list of objects, in this case as a list of
strings finished by an object which is assigned to the variable aCollection. The
object assigned to aCollection is then checked for its conformance with a Java-
interface. The condition-part of this rule simulates the checks which are performed
when one invokes a method in Java. The main difference between this rule and Java is
that Java uses static binding of method names rather than dynamic ones.
Some of the constructs which can be used to build programs are summarized in
table 1. The last construct enables to process a specified message by a specified
behavior on the behalf of the current object. This enables the programmer to represent
patterns similar to inheritance.

Tab. 1. Examples of various constructs


Name Type
Assignment Statement
Selector Expression
Reference to receiver (i.e. self) Expression
Currently processed message Expression
Instance-of check Expression
Conditional execution Statement
While-iteration Statement
For-iteration Statement
Global variable declaration Statement
Global variable check Expression
A variant of message sending Statement
Interpretation of a message by a Statement
specified behavior

6 Comparison with other approaches


The model of computation takes its inspiration from various sources. The idea to treat
object’s behavior as a set of rules with a condition-part and an action-part is similar to
a rule of a Turing machine [2] or of a production system [8]. Some parts of the
concurrent computation model and its implementation, like continuation and futures,
came from the Actors computational model [4]. However, the model of computation
was introduced only to provide a base for building an extensible programming
language.
190 Ján Žiak

Contemporary approaches to extensible programming languages work with


textual source files [6, 7, 8]. The constructs must be specified as text and must be
clearly distinguishable from other constructs in a syntactic way. The approach of this
article was to make a clear statement about the relation between construct’s syntax and
semantics and to use graphical objects to represent the syntax in an arbitrary way.
Syntax (i.e. visualization) of one construct does not influence other constructs in the
same way as it being done in the case of textual representations.
The apt tool [6] parses the source code and represents it by object-oriented
structures which reflect the structure and elements of the source code. This
representation is then processed by a procedural annotation processor modifying the
Java source code and potentially generating new source files. Although the
transformation of the source code is procedural (i.e. it is not a macro) the generated
code has to be in the Java language. On the other hand, the approach used in this article
makes no transformation of constructs into language X, but creates custom objects
representing the semantics of the construct. This object-oriented representation of the
constructs‘ semantics is final because the environment in which the objects live is
persistent.

7 Conclusions
This article described a method of extending a concurrent programming language with
new constructs. The initial programming language is minimal. New constructs with
new capabilities can be added to the language in order to extend it. The syntax of
constructs is specified mainly by their graphical appearance and need not to be
represented by text only.
The suggested method should enable the system to survive over a long period of
time because new constructs with new meanings can be added to the language. The
system does not initially contain constructs (except the constructs for simple message
send and subexpression evaluation), so the set of constructs is in fact initially empty.
Old-fashioned constructs which are no longer being used by programmers should be
those that loose the struggle for survival among various different constructs with
different semantics.
It should be noted that this article presented the implementation in an idealistic
way and omits a precise description of the implementation.
There remains a lot of work which should be done in the future. First of all, the
environment has not been tested in practice in a community of programmers. However,
the odds that it would keep its promise of being evolutionary seem to be high. The
environment should be populated with numerous new constructs – which would surely
entail the necessity for some changes in the current prototypical implementation.

Acknowledgement: This work was supported by Scientific Grant Agency of the


Ministry of Education of Slovak Republic and the Slovak Academy of Sciences under
grant No. VG 1/0161/03 (Information Processing in Distributed Environment of
Intelligent Agents).
Design and Prototype Implementation of an Evolutionary Environment... 191

References
1. Hodge, R., Kress, G.: Social Semiotics. Cornell University Press, Ithaca, 1988.
2. Turing, A.M.: On Computable Numbers, with an Application to the Entscheidungs
Problem. In: Proceedings of the London Mathematical Society, Vol. 42, No. 2
(1937), 230-265.
3. Ungar, D., Smith, R.B.: SELF: The Power of Simplicity. Lisp and Symbolic
Computation: An International Journal, Vol. 4, No. 3 (1991)
4. Agha, G.: Concurrent Object-Oriented Programming, Communications of the
ACM, Vol. 33, No. 9 (1990), 125-141.
5. Bachrach, J., Playford, K.: The Java Syntactic Extender. In: Proceedings of
OOPSLA’01, Tampa, Florida (2001), 31-42.
6. Getting Started with the Annotation Processing Tool (apt)., Sun Microsystems,
2005. http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html
7. Wilson, G.V.: Extensible Programming Systems for the 21st Century, ACM Queue
(2004), http://www.third-bit.com/~gvwilson/xmlprog.html
8. Russell, S.J., Norvig, P.: Artificial Intelligence: A Modern Approach. Prentice
Hall, New Jersey, 1995.
9. The Homepage of Squeak, http://www.squeak.org
10. Eckel, B.: Thinking in Java (3rd Edition). Prentice Hall, 2002.
Web Technologies
and
Information Systems
Spot-it – Going Beyond the Vision Loss
Boundaries
Martin ADAM, Michal BARLA
Peter SIVÁK , Michal TVAROŽEK ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
csidc@atrip.sk

Abstract. At present, visionless people are dependent on others for all


but the most basic of tasks. The main goal of our project is to allow
them to be more independent and thus improve the quality of their
lives by providing them with additional information about their
surroundings. We associate textual information stored on a server in
the Internet with RFID tags, which are used to tag various objects. The
user is equipped with a mobile device with an attached RFID reader,
which detects these tags, retrieves the associated information and
presents it to the user in spoken form.

1 Introduction
Nowadays, vast amounts of information are available to many people all around the
world. What is more, the volume of available information is growing daily and it thus
becomes increasingly difficult to organize, search and access this information. The
problem of information processing will become even more severe when people from
currently less developed countries start using and adding to this information on a scale
comparable to developed countries.
In order to respond to the challenge of present and future information processing
needs we devised a system, which allows for organizing and finding relevant
information related to a particular environment quickly and efficiently. Moreover, it is
able to supply this information to people who need it, at places where they need it and
at the exact time they need it – to anyone anywhere and anytime. In this way, it eases


Supervisor: doc. Ing. Mária Bieliková, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 195-200.


196 M.Adam, M.Barla, et al.

off the threat of excess information, and thus goes a step beyond the current boundaries
of information processing capabilities.

2 System overview
The ultimate purpose of the SPOT-IT system is to provide an alternative way of
information acquisition for visually impaired people. To accomplish this goal the
system utilizes different components (see Fig. 1.).

Fig. 1. Overview of the Spot-it system.

RFID tags are used to tag various objects or information. During operation the
user carries a mobile device (e.g., a PDA or a Smartphone equipped with additional
add-ons) with the corresponding application software. The input is gathered by an
RFID reader, which searches for RFID tags near the user and forwards the acquired
data to the mobile device for further processing. Depending on the actual data, the
system retrieves additional information from RNS (RFID Name Service) and RTS
Spot-it – Going Beyond the Vision Loss Boundaries 197

(RFID Tag Service) servers over the Internet. When all data retrieval and processing is
complete, the results are presented to the user by means of a synthesized voice, which
is transmitted to headphones either via a wired or a wireless personal area network.
Each RFID tag contains data, which uniquely identify a message that is presented
to the user when a tag is detected nearby. If an RFID tag contains only a reference to
the data and not the actual data, then the SPOT-IT system uses a distributed group of
RNS and RTS servers to interpret the reference into meaningful information, which is
presented to the user. The conversion is a two-stage process, in which first the RTS
server, which contains the actual tag data is identified by means of the RNS web-
service. Thereafter the data is downloaded onto the mobile device for further
processing from the respective RTS server.
The SPOT-IT system software is based on client-server architecture. The client
side comprises the mobile device software developed using an object-oriented
approach, whereas the server side comprises the RNS and RTS web-services, which
use a service-oriented architecture (SOA) [1]. Both the RNS and the RTS web-services
feature two different interfaces. The default web-service interface allows for direct
access from other applications (e.g., the mobile device), whereas an additional web
interface facilitates access to data associated with RFID tags and allows for its simple
modification by RFID tag owners (e.g. changing the contents of a message). System
administrators can use the web interface to manage system settings (e.g., adding a new
RTS server).
The client software’s purpose is to find and identify RFID tags near the user,
retrieve the associated data and determine whether the message should be presented to
the user. Finally, the software should present the message and allow the user to affect
its playback by means of a simple user interface. This would include skipping, pausing
or replaying the message, replaying it at a slower pace or even replay it letter by letter.
To accommodate this functionality we opted for modular software architecture, with
modules reflecting the described functions of the system. This approach also allowed
for independent development of the individual modules and easier extensibility.

2.1 RFID tags and the data stored within

After evaluating the available possibilities, we decided to associate entities with RFID
tags, because they can store data unique to each such entity [4]. Thus the SPOT-IT
system introduces a new possible utilization of the RFID technology as compared to its
present commercial use where it is meant to replace barcodes for tracking goods,
animals or even people.
RFID tags can be very small, cheap and easy to use, with the only condition being
that the user must be in visible proximity of the RFID tag. The SPOT-IT system
employs high frequency passive tags, which do not require their own power source and
thus need no maintenance. These tags comply with the ISO 15693 standard and offer
enough flash memory for user data.
The memory itself is divided into 4-byte blocks with a total of 64 blocks. Every
time data are read from or written to memory, they have to be read or written in these
198 M.Adam, M.Barla, et al.

4-byte blocks. This fact has affected the data format in which the SPOT-IT system
stores data in RFID chips.
In addition to identifying an object with a unique code, we also decided to use the
chip’s memory to store data about what kind of object it is (in the category field) and in
some cases even to provide all necessary information without obtaining any further
data from a server in the Internet. The SPOT-IT system needs at least 16 bytes of the
chip’s memory, which result in exactly 4 blocks of memory (see Fig. 2).

Version OwnerID ChipID Category Checksum Reserved Length Data


1 6 2 2 2 1 2 0-N
byte bytes bytes bytes bytes byte bytes bytes
Fig. 2. RFID tag data format.

• Version determines the version of the SPOT-IT tag data format for future
format extensions.
• OwnerID is a unique code for a person or an organization, which can
distribute SPOT-IT tags. This code is used in RNS server queries.
• ChipID is a code, which determines which message is associated with the tag.
This code is used in RTS server queries.
• Category is a code, which identifies what kind of message is associated with
the SPOT-IT tag.
• Checksum is computed from the contents of a SPOT-IT tag and has two
functions – error checking and distinguishing of SPOT-IT tags from tags of
other systems.
• Reserved – reserved for future use.
• Length is the length of additional data contained directly in the RFID tag,
which are associated with the chip; (from 0 to 64K).
• Data – if length is greater than zero, this contains the additional information.

2.2 Message content representation

The SPOT-IT system stores messages on RTS servers, which enables us to incorporate
additional features focusing on the message content. The usage of dynamic instead of
static content is one such feature. To achieve this we developed a novel way of
dynamic content representation – Contextual Information Description Language
(CIDL).
CIDL is a simple, yet powerful XML based general-purpose description language
for the representation of additional contextual information about real-world objects. It
makes possible for example that the actual message associated with a single entity can
Spot-it – Going Beyond the Vision Loss Boundaries 199

vary depending on the current time or date. The main idea is to encapsulate
information represented by other XML-based languages into a single message
associated with an entity. Each part is independent and is distinguished with a
namespace. This allows for the development of new devices which will be able to
process additional information (represented by different sections, which use a new
namespace) while not affecting existing devices.

2.3 RNS and RTS web-services

Since one of our aims is to maximize the reusability and adaptability of the server side
of SPOT-IT system we decided to implement it using a service-oriented architecture
(SOA). To fulfill the key requirements of SOA we used a web service implementation
provided by the Microsoft .NET Framework. There are two types of services in the
system: RFID Name Service (RNS) and RFID Tag Service (RTS), which are accessed
by mobile devices through an Internet connection and by chip owners.
The RTS server is designed to provide CIDL encoded messages associated with
an RFID tag, which are described by an ownerID and a chipID. Since a list of usable
CIDL namespaces can be included in each request, the RTS server returns only the
appropriate sections, which use these namespaces. The requirement to use namespaces
in queries together with the nature of the stored data suggest that a native XML DBMS
would offer a more flexible query engine compared to a relational DBMS.
In order to allow anyone to run an RTS server we designed the RFID Name
Service – RNS. This service allows clients to determine which RTS server stores
messages associated with RFID tags. It is a simple service, which requires the ownerID
from the RFID tag and returns the URL address of the desired RTS server, where the
information associated with the RFID tag is stored. The RNS server also has a web
interface used for management.
Both services require a database for data storage. While RNS uses a standard
relational database, we opted for a native XML database for RTS, which is fully
extensible and allows us to make use of all advantages of CIDL.
To maximize the processing speed RNS uses procedures stored on the database
server to query the database. This solution saves bandwidth and brings better
performance, because stored procedures are compiled and stored in executable form on
the database server itself.

3 Conclusions
The proposed system brings several major benefits to society. For one it offers a novel
way of organizing, sorting and acquiring information, which can also be based on user
location. Our implementation in the form of the SPOT-IT system is targeted primarily at
blind or severely visually impaired people whom it offers a unique way to acquire
contextual information about their surroundings. The resulting benefits it provides to
these people in terms of increased independence, self-sufficiency and quality of life are
immense.
200 M.Adam, M.Barla, et al.

Furthermore, the SPOT-IT system itself is only one example of the system’s
overall capabilities. The concepts and ideas described in this paper can be applied to a
whole family of systems designed for a particular application domain targeted at
sighted people thus providing new possibilities of information acquisition and
processing.
To fulfill its design objectives the SPOT-IT system makes use of several vital
innovations:
• Using RFID tags to tag entities (be it objects or information) with the purpose
of providing people with contextual information. Amongst others, this
provides the blind with an alternative way to detect (i.e., “to see”) the entities.
• A way of communication with the visually impaired by means of a fully
featured text-to-speech engine, while using only the limited computing
resources of a mobile device.
• A novel approach to wireless data transfer in a PAN via data transmission
through the human body.
• Open architecture based on the Microsoft .NET platform, which allows for
easy extensibility of the system.
• Using SOA to develop a set of Web-services, which provide the required
functionality to a broad audience of users. SOA keeps the interface and
functionality separated thus allowing anyone to implement his own interface.
• The use of an XML database to store data associated with RFID tags.
From an implementation standpoint, we have successfully designed, developed
and tested the main components of the system. Their implementation proves the
viability of the proposed concept, which is based on the novel usage of RFID tags
aimed at supplying relevant contextual information anywhere and anytime.
Consequently, the project is in the state of system integration and testing.

References
1. Barry, D.K.: Web Services and Service-Oriented Architecture. Morgan Kaufmann
Publishers, San Francisco 2003.
2. Kačmář, D.: Programming .NET applications. Computer Press, Prague 2001. (in
Czech)
3. Prosise, J.: Programming Microsoft ® .NET. Microsoft Press, Redmond 2002.
ISBN 0-7356-1376-1.
4. Stanford, V.: Pervasive Computing Goes the Last Hundred Feet with RFID
Systems. In IEEE Pervasive Computing [online]. Vol. 2, No. 2 (2003) 9-14.
http://csdl.computer.org/comp/mags/pc/2003/02/b2toc.htm (2005-04-07)
Diablo 2 Tools
Pavol HLUCHÝ∗
Slovenská technická univerzita
Fakulta informatiky a informačných technológií
Ilkovičova 3, 842 16 Bratislava, Slovenská republika
hluchy@fa.stuba.sk

Abstrakt. Cieľom tejto práce je vytvoriť softvérové nástroje, ktoré


uľahčia tvorbu internetových stránok venujúcich sa hre Diablo 2.
Jeden z modulov slúži na ukladanie herných objektov - predmetov
vo formáte D2I do databázy a jej následné prehľadávanie podľa
rôznych kritérií. Má formu modulu do redakčného systému PHPNuke.
Ďalší modul je vo forme zdieľanej knižnice pre OS Linux. Umožňuje
konverziu grafiky z DC6 formátu používaného v hre do obrázkov
vo formáte GIF, PNG alebo JPG použiteľného pri tvorbe
internetových stránok.

1 Úvod
Diablo 2 [3] je počítačová hra od firmy Blizzard [1]. Bola vydaná 24. júna 2000 ako
nasledovník hry Diablo a 26. júna 2001 bol k nej vydaný datadisk Lord of Destruction.
Napriek tomu že je relatívne staršia, je stále veľmi obľúbená a intenzívne hraná.
Veľkým problémom pri hraní tejto hry býva skutočnosť že hráč počas hrania
získa množstvo herných objektov – predmetov ktoré aktuálne pri danej postave
nepotrebuje ale využije ich neskôr alebo pri inej postave, pričom prenos týchto
predmetov medzi postavami je pomerne problematický. Ako riešenie slúži modul
na načítavanie predmetov v D2I (Diablo2Item) formáte (natívny formát hry, ktorý
používajú na export predmetov aj rôzne editory postáv), ich spracovanie, zatriedenie
v databáze a uchovanie. Následne je možné v takto vytvorenej databáze vyhľadávať
podľa kritérií a uložené predmety potom použiť pri tvorbe inej postavy.
Ďalšia požiadavka je získanie obrázkov z hry pre účely ďalšieho spracovania.
Keďže však hra používa vlastný formát, treba na to vytvoriť nástroj na konverziu
do štandardných formátov.


Vedúci práce: Ing. Branislav Steinmüller, Ústav aplikovanej informatiky, Fakulta informatiky
a informačných technológií STU v Bratislave

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 201-206.


202 Pavol Hluchý

2 D2I databáza
D2I databáza slúži na vytváranie prehľadných záznamov o predmetoch,
ich kategorizáciu a jednoduché získavanie pre účely neskoršieho použitia. Preto prístup
do takejto databázy je vhodné obmedziť na registráciu, pri ktorej používateľ musí
odsúhlasiť určité pravidlá jej používania, ako napr. zákaz vkladania predmetov ktoré
boli upravované. K tomu je vhodné použiť už nejaký existujúci systém, v rámci
ktorého by mali byť implementované aj niektoré ďalšie veci, ako napr. uľahčenie
tvorby stránok v ucelenom dizajne a pod. Ako dobrá voľba sa ponúka PHP-Nuke
systém [6], ktorý poskytuje všetko potrebné a navyše umožnňuje použiť rôzne
databázové systémy. Preto aj modul D2Idb bol vytvorený pre tento systém. Takže bolo
potrebné len navrhnúť a vytvoriť databázu vyhovujúcu zadanému účelu a nad tou
vybudovať celú administratívu.

2.1 Vnútorná štruktúra súborov a ich spracovanie

Súbor D2I sa člení na niekoľko častí. Prvá časť obsahuje len najzákladnejšie
informácie o predmete. Predmety ktoré majú len túto časť sa nazývajú Basic items.
Sú to napr. kľúče, zvitky, lekváre a pod. Tieto informácie sú uložené v samostatnej
tabuľke. K tomu ešte tabuľka Basic vlastností predmetu obsahuje už niektoré
predpripravené hodnoty ako je napr. zobrazované meno predmetu, minimálne
požiadavky na postavu ktorá môže predmet používať alebo aj odkaz na tabuľku
s informáciami o používateľovi ktorý tento predmet do databázy vložil.
Po Basic časti nasleduje čast popisujúca umiestnenie predmetu na postave.
S ohľadom na fakt, že predmety sa ukladajú do databázy bez akejkoľvek nadväznosti
na postavy, je táto časť ignorovaná.
Ďalej nasleduje časť, ktorá definuje presnejšie typ predmetu a jeho kvalitu, t.j. či
ide o unikátny predmet, magický a pod. a tzv. „level“ predmetu. Následne ešte
obsahuje niektoré doplňujúce informácie špecifické pre určité typy predmetov, napr.
niektoré magické vlastnosti vzácnych predmetov definované pomocou magických
prefixov a sufixov. Táto časť sa tiež ukladá do samostatnej tabuľky.
Po tejto časti nasledujú už údaje špecifické pre každý typ predmetu. Pre zbrane
je to napr. rozsah poškodenia ktoré spôsobujú, pre brnenia zase ich celková výdrž
a aktuálna, t.j. nakoľko sú už poškodené. Následne potom popis všetkých magických
vlastností predmetu. Tejto časti je tiež určená jedna samostatná tabuľka.
Aby sa do týchto troch tabuliek vkladalo čo najmenej informácií, pričom
množstvo z nich sa často opakuje, sú vytvorené rôzne indexové tabuľky. V nich
sú zoznamy hodnôt ktoré prislúchajú jednotlivým indexom používaným v D2I
súboroch. Vďaka tomu je potom aj oveľa jednoduchšie a hlavne rýchlejšie
vyhľadávanie podľa kritérií. Sú to napríklad zoznamy magických prefixov a sufixov
s ich magickými účinkami, zoznamy zbraní aj s ich špecifickými parametrami,
zoznamy drahokamov a ďalšie.
Diablo 2 Tools 203

Obr. 1. Časť návrhu štruktúry tabuliek v databáze

Podľa týchto požiadaviek a štruktúry D2I súboru je vytvorený návrh štruktúry


tabuliek a ich vzájomných prepojení (obr. 1). Pri vytváraní výslednej štruktúry tabuliek
sa vyskytli nejaké problémy so vzájomnými odkazmi tabuliek, tie však boli vyriešené
pridaním jednej tabuľky navyše do ktorej sa vložili všetky potrebné informácie.
Samotný modul potom zabezpečuje načítanie súboru a jeho spracovanie. V rámci
spracovania sa súbor pripraví do štruktúr vhodných na vloženie do databázy.
Pred samotným vložením sa však ešte vykoná kontrola na niektoré špecifické znaky
poukazujúce na nedovolené úpravy predmetu, skontroluje sa či taký predmet náhodou
už nie je v databáze – ide najmä o Basic predmety a ešte sa overí či nie je v zozname
predmetov, ktoré sa vyskytujú na Internete. Tým sa v podstate určí požiadavka
na vkladanie predmetov ktoré používateľ získal sám počas hrania hry. Ak predmet
vyhovie všetkým kontrolám, je vložený do databázy a sprístupnený ostatným
používateľom na využitie. V prípade, že nevyhovie niektorej podmienke, je takýto
predmet ignorovaný a používateľ ktorý sa ho pokúsil vložiť je na to upozornený.
204 Pavol Hluchý

3 Konverzia grafiky

3.1 Základné informácie

Grafika v hre je väčšinou ukladaná v dvoch až troch samostatných súboroch. Prvý


súbor vo formáte DC6 slúži na uloženie obrázku, príp. viacerých obrázkov pričom
farby sú určené len indexami príslušnej palety. Druhý je tiež v DC6 formáte, avšak
tento súbor je použitý len v niektorých špecifických prípadoch, ako je napríklad
animovaný obrázok pri výbere typu postavy. V tomto prípade prvý DC6 súbor
obsahuje samotnú postavu a druhý jej „auru“. Tieto 2 obrázky sa potom zlučujú
do jedného. Tretí súbor je vo formáte DAT a obsahuje definície farieb - paletu. Paleta
má vždy 256 farieb v rozlíšení 3 x 8 bitov.

3.2 DC6 formát

Tento formát súboru má 3 základné časti:


1. hlavička
2. pole ukazovateľov na bloky
3. bloky obrázkov
pričom časti 2 a 3 sú vlastne 2-rozmerné polia, kde riadky tvoria pohľady na
postavu alebo predmet a v rámci každého riadku sú obrázky tvoriace animáciu v tomto
pohľade.
V hlavičke súboru je uvedená jeho verzia, použité ukončovacie znaky, počet
pohľadov a počet obrázkov - framov na 1 pohľad. Pole ukazovateľov na bloky
obsahuje ukazovateľe na jednotlivé bloky obrázkov v súbore, čo sú v podstate
posunutia v rámci súboru. Potom už nasledujú jednotlivé obrázky.
Blok obrázku vždy začína vlastnou blokovou hlavičkou v ktorej je špecifikovaný
rozmer obrázku, jeho posunutie v rámci animácie príslušného pohľadu, ukazovateľ
na nasledujúci blok a dĺžka bloku. Po tejto hlavičke sú už zapísané jednotlivé body
obrázku, pričom sa vykresľuje zospodu hore.
Všetky popisné údaje v DC6 súbore sú 32 bitové. Až samotné body obrázkov
sú zapisované 8 bitovými číslami.

3.3 DAT formát palety

Súbor palety má vždy veľkosť 768 bajtov. Je to dané tým, že každá farba má 3 zložky
pričom každá zložka je zapísaná 1 bajtom. Takže je k dispozícii 256 farieb v 24 bitovej
farebnej hĺbke. Samotné farby sú potom uložené postupne podľa indexov pričom každá
farba má zložky uložené v poradí modrá, zelená, červená.
Diablo 2 Tools 205

3.4 Spracovanie a konverzia

DC6 a DAT súbory sa spracúvajú spoločne. Najprv sa vždy načíta súbor palety
a následne sa načíta DC6 súbor. Pri jeho načítavaní a konverzii sa používa
GD knižnica [2], ktorá poskytuje podporu pre formáty GIF, PNG a JPG. Postupne
ako sa načítava blok s jedným obrázkom, je vykresľovaný do štruktúry obrázka
v GD knižnici. Takto načítaný obrázok je potom možné uložiť do niektorého
z formátov podporovaných GD knižnicou. Jeho rozmery sú vždy rovnaké ako bolo
určené v hlavičke príslušného bloku. Ak je potrebné získať obrázky pre vygenerovanie
animácie, treba prepočítať rozmer výslednej animácie pomocou veľkosti a posunutia
každého obrázku ako je definované v ich príslušných blokových hlavičkách. Tak isto
potom je potrebné spočítať výslednú veľkosť obrázkov v prípade spájania obrázkov
postavy a „aury“ do výsledných obrázkov.
Samotné spájanie obrázku tela a „aury“ sa potom vykoná tak, že obrázok tela
sa skopíruje do výsledného prázdneho obrázku na správnu pozíciu a následne sa bod
po bode sčítaním farby bodu tela a „aury“ spočítajú nové body vo výslednom obrázku.
Výsledné obrázky sa potom získavajú v podobe ukazovateľa na štruktúru GD
knižnice reprezentujúcej požadovaný obrázok. Tým je zabezpečené že v programe,
ktorý použije knižnicu je možné určiť výsledný formát obrázku.

4 Implementácia
Moduly boli naprogramované v OS Linux. Nemal by však byť problém sprevádzkovať
ich aj na Windows kedže sa nepoužívajú žiadne špecifické vlastnosti alebo funkcie.
Funkčný D2I databázový modul je sprevádzkovaný na slovenskej internetovej
stránke s názvom „Lolec“ [5] ktorá má za cieľ vytvoriť čo najväčšiu databázu
predmetov používaných v hre. Modul je naprogramovaný v PHP rovnako ako celý
PHP-Nuke systém pre ktorý je určený. Aktuálne prebieha jeho testovanie a odladenie
pred umožnením jeho používania väčšiemu počtu ľudí.
DC6 knižnica je programovaná vo vývojovom prostredí Eclipse [4], ktoré je
dostupné pre OS Linux aj Windows. Táto knižnica má rozhranie v jazyku C čo
umožňuje vytvoriť jej nadstavby a rozhrania pre iné programovacie jazyky ako je napr.
C++, Perl a iné. Je použitá na tvorbu php_ext modulu, ktorý sa dá použiť v rámci
internet stránok tvorených pomocou PHP. Tento modul má objektové rozhranie pričom
knižnica samotná má rozhranie len v jazyku C.

5 Záver
Cieľom tejto práce bolo vytvoriť základné nástroje pre uľahčenie tvorby internetových
stránok zaoberajúcich sa problematikou hry Diablo2. Uvedené moduly by mali
umožniť zvládnutie aspoň najzákladnejších operácií pri ich tvorbe. Kedže však tvoria
len časť potrebných nástrojov, je naplánované pridanie podpory pre ďalšie formáty
súborov ktoré sa v hre používajú, napr. D2S, DT1, DS1 a iné. Rovnako sa pripravuje
aj umožnenie konverzie obrázkov do DC6 formátu pre potreby vytvárania rôznych
206 Pavol Hluchý

modifikácií hry. Pre uľahčenie používania bude následne vytvorené vhodné grafické
rozhranie ktoré umožní prezrieť si obrázky pred ich skonvertovaním a uložením na
disk. Tým sa zaistí, že sa nebudú zbytočne generovať súbory, ktoré nie sú potrebné.

Použitá literatúra
1. Blizzard Entertainment. http://www.blizzard.com
2. Boutell.Com, Inc.: gd 2.0.33. A graphics library for fast image creation.
http://www.boutell.com/gd/manual2.0.33.html
3. Diablo 2. http://www.blizzard.com/diablo2
4. Eclipse.org. http://www.eclipse.org
5. Lolec – Lopo’s online LoD equipment library. http://lolec.losys.sk
6. PHP-Nuke open source professional portal system. http://www.phpnuke.org
7. Siramy, P.: COF, D2, DC6, DS1, DT1, TBL File format. phrozenKEEP Forums,
http://phrozenkeep.it-point.com/forum/viewtopic.php?t=724.
8. Trevin Beattie: Diablo II Item Format for Diablo II v1.09 and the Diablo II
Expansion Set: Lord of Destruction. 2003.
http://www.xmission.com/~trevin/DiabloIIv1.09_Item_Format.shtml

Annotation

Diablo 2 Tools
The aim of this work is to create software tools to simplify creation of internet pages devoted
to this game. One module implements database for storing game items in D2I format. Items can
be browsed and searched by various criteria. Module is implemented as PHP-Nuke module.
Other module is a shared library for linux OS. The library allows conversion of graphics from
DC6 format, used in the game, to GIF, PNG or JPG format inteded for web page design.
SecuFORM – webform PHP Framework
Ján ŠARMÍR∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
jan.sarmir@sorudan.sk

Abstract. Description of PHP framework SecuFORM, which is


dedicated to web application developers, who need to process broad
web forms or large amount of logically interconnected web forms,
with respect to security and data integrity of processed data. The work
covers specification and implementation process description, practical
usage examples and some short real life implementation case studies.

1 Úvod
Spracovanie užívateľských vstupov v oblasti webových aplikácií patrí medzi kľúčové
momenty návrhu a implementácie. Užívateľovi treba ponúknuť rovnakú intuitívnosť
ovládania, interaktivitu a komfort, aké by mu ponúkla aplikácia bežiaca priamo na jeho
počítači. Navyše si treba uvedomiť, že výsledný kód stránky je dostupný priamo
v čitateľnom texte a preto treba dbať na zvýšenú bezpečnosť spracovávania vstupných
dát.
V súčasnosti existuje niekoľko frameworkov, ktoré sú určené, alebo môžu byť
použité na spracovávanie vstupných dát webovými aplikáciami. Väčšina z nich je
určená pre platformu Java (Struts) a nešpecializuje sa len na vytváranie webových
formulárov, ale má širšie a komplexnejšie využitie. Jedným z úzko špecializovaných
frameworkov pre spracovanie webových formulárov je framework Blueshoes, ktorý je
určený pre skriptovací jazyk PHP. Hlavnou výhodou tohoto nástroja je dlhodobý vývoj
a stabilita, na druhej strane sa potýka s nedostatkom flexibility a ťažkopádnosťou
nasadenia. Existuje ešte niekoľko podobných riešení, no s ohľadom na rozšírenosť
jazyka PHP v malých a stredne veľkých webových aplikáciách a stále narastajúci počet
nasadení je toto množstvo a hlavne kvalita nedostatočná. Tento problém sa snaží
vyriešiť framework SecuFORM.


Supervisor: Ing. Ivan Kapustík, Institute of Informatics and Software Engineering, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 207-212.


208 Ján Šarmír

2 Charakteristika systému
Framework SecuFORM sa stal odpoveďou na potrebu vytvorenia nástroja, ktorý by
bolo možné použiť na spracovanie rozsiahlych formulárových systémov s vysokým
stupňom bezpečnosti a integrity v prostredí skriptovacieho jazyka PHP. Potreba
vznikla v procese návrhu a implementácie aplikácií v tíme, ktorého som súčasťou
a ktorý ma poveril vývojom tohoto frameworku.
Hlavnou myšlienkou systému SecuFORM je jednoduché použitie z hľadiska
nasadenia v aplikáciách pri zachovaní maximálnej miery flexibility a znovu
použiteľnosti.

2.1 Základné vlastnosti systému

Framework je riešený objektovo, obsahuje metódy potrebné pre vytvorenie,


spracovanie formulárov a interakciu s databázou. Vlastné formuláre sa generujú z
“inteligentných” šablón, ktoré obsahujú kompletnú html štruktúru výsledného
dokumentu, ktorá je rozdelená do pasívnej časti (časť, ktorá nie je systémom menená)
a z aktívnej časti (časť obsahujúca html tagy a riadiace inštrukcie, ktoré ovplyvňujú
správanie sa systému – napríklad obmedzenia pre vstupné hodnoty, názvy stĺpcov
v databáze, typ vstupného poľa a podobne). Toto riešenie zabezpečuje umiestnenie
všetkých potrebných údajov pre konkrétny formulár v rámci jedného dokumentu a tým
jeho nezávislosť od zvyšku systému, ľahkú modifikovateľnosť a znovu použiteľnosť.
Po vyplnení a odoslaní formulára sa vstupné údaje skontrolujú, otestuje sa, či sa
užívateľ nepokúšal o nepovolený zásah do štruktúry dát (zmena názvu premenných,
viacnásobné odoslanie formulára – “refresh effect” a podobne). V prípade, že údaje
úspešne prešli všetkými testmi, sú dáta uložené do databázy, v opačnom prípade
systém upozorní na prípadné nedostatky.

2.2 Štruktúra šablóny, podporované vstupné polia

Základným stavebným kameňom sú šablóny pre formuláre. Základná štruktúra šablóny


je nasledovná a bude vysvetlená na príklade(číslovanie riadkov nepatrí do štruktúry) :

01: <form action="process.php" method="post" name="signed_form">


02: <h1>Testing form<h1>
03: <span>Please fill the follow question</span>
04: {#question1;textarea;minlength(1);maxlength(500)# #remark1#
05: <span[#NMARK# style="color: #F00;"#]>Questiontext</span><br>
06: <span>Max. 500 characters (obligatory).</span><br>
07:<textarea name="[#NAME#]">[#VALUE#] [#DMARK#Fill here#]</textarea>
08: #}
09:{#question2;input;maxlength(100)# #remark2#
10: ...
11: ...
SecuFORM – webform PHP Framework 209

12: …
13: #}
14: <input type=”submit” value=”Submit the form”>
15: </form>

Riadky 01 - 03 sú pasívnymi súčasťami šablóny, jedinou výnimkou je vlastnosť


action tagu <form>. K textu process.php sa pripojí informácia o aktuálnej session.
Riadok 04 je začiatkom aktívneho bloku. Každý blok začína sekvenciou znakov {#
a končí sekvenciou #}. Jednotlivé príkazy alebo príznaky sú oddelené bodkočiarkou,
značky (marks) začínajú sekvenciou [#a končia sekvenciou #].Po začiatočnej sekvencii
nasleduje názov bloku (zároveň názov stĺpca v databáze). V našom príklade je to
question1, za ním nasleduje typ vstupného poľa (textarea), potom zoznam obmedzení
pre daný vstup(minlength(1) – znamená, že minimálna dĺžka vstupu je 1 znak,
maxlength(500) – znamená, že maximálna dĺžka vstupu je 500 znakov). Zoznam môže
obsahovať neobmedzený počet podmienok pre vstup. Riadok uzatvára poznámka
k bloku #remark1#. Riadok 05 obsahuje tag <span> a sekvenciu [#NMARK#
style="color: #F00;"#] ktorá zabezpečí vypísanie textu style="color: #F00;" do
výsledného formulára v prípade, že po odoslaní odpoveď neprejde ohraničujúcimi
podmienkami. V našom prípade táto značka spôsobí zmenu farby textu otázky na
červenú. Riadok 06 obsahuje poznámku k odpovedi. Na riadku 07 sa nachádza
samotný tag <textarea>. Značka "[#NAME#] dosadí do názvu premennej náhodný
hash, značka [#VALUE#] je nahradená prázdnym reťazcom v prípade, že formulár bol
vypísaný prvýkrát, zlou hodnotou v prípade, že formulár bol odmietnutý, hodnotou z
databázy v prípade, že sa jedná o editovanie formulára. Text v značke [#DMARK#Fill
here#] sa vypíše vtedy, ak sa formulár zobrazil prvýkrát (default mark – ak sa nejedná
o vrátený alebo editovaný formulár). Riadok 08 ukončuje blok, riadky 09 – 13 patria
ďalšiemu bloku. Riadok 14 zabezpečuje odoslanie a 15 ukončuje formu. Pred riadok
15 sa automaticky vloží ešte hidden <input> tag, ktorý v sebe nesie digitálny podpis
formulára. Text šablóny môže pokračovať a môžu sa v ňom využiť aj niektoré globálne
značky.
Systém podporuje všetky štandardné vstupy, t.j. INPUT typov TEXT,
PASSWORD, HIDDEN, SUBMIT, RESET, RADIO, vstup typu TEXTAREA,
CHECKBOX, SELECT a MULTIPLE SELECT.

2.3 Zoznam niektorých podporovaných značiek

Podporované je veľké množstvo značiek, ktoré poskytujú užívateľovi v kombinácii


s možnosťou použitia html kódu priamo v šablóne takmer nekonečnú flexibilitu.
Zoznam niektorých značiek:
1. #MARK#text# (MARK) - značka sa nahradí textom, ak odpoveď vyhovuje
podmienkam
2. [#NMARK#text#] (NOTMARK) – značka sa nahradí textom, ak odpoveď
nevyhovuje podmienkam
210 Ján Šarmír

3. [#DMARK#text#] (DEFAULTMARK) – značka sa nahradí textom, ak je


formulár zobrazený prvýkrát
4. [#NAME#] – značka je nahradená hashom pre danú odpoveď
5. [#VALUE#] – značka je nahradená hodnotou odpovede
6. [#CMARK#x#text#] (CECHKEDMARK) – značka sa používa v prípade
skupiny checkboxov, je nahradená textom v prípade, že hodnota value
checkboxu sa rovná x
7. [#CNMARK#x#text#] (NOTCHECKEDMARK) – ako predošlá značka,
negovaný význam

2.4 Podpora databázy

Framework transparentne podporuje databázu (zápis alebo modifikáciu dát v databáze


v prípade odoslania formulára, načítanie hodnôt pre formulár v prípade jeho
editovania). Programátorovi stačí poskytnúť deskriptor na databázu, názov tabuľky,
ktorá prislúcha k formuláru a identifikátor riadku, v ktorom sa nachádza príslušný
záznam. Pri zápise dát do DB sa vytvorí riadok s príslušným identifikátorom (ak
neexistuje) alebo sa modifikujú dáta v už existujúcom riadku. Názvy stĺpcov sa určujú
z názvov blokov v šablóne. Ak v databáze existujú stĺpce, ktoré nie sú v šablóne, tieto
sa pri zápise do riadku ignorujú (pri prepisovaní sa ich hodnota nezmení, pri vytváraní
riadku sa nastavia na východzie hodnoty) V prípade, že v šablóne existujú bloky, ku
ktorým v databáze neprislúcha žiaden stĺpec, tieto sú ignorované. To dáva
programátorovi možnosť vytvoriť šablónu, ktorá bude modifikovať len časť dát alebo
vytvoriť formulár, ktorý nebude celý uložený do databázy.

2.5 Systém spracovania formulára

Obrázok 1 zachytáva spôsob spracovania dát a vytvorenia formulára. V bode 1 sa


inicializuje objekt, ktorému sa predajú potrebné údaje. V bode 2 sa zistí, či je
nastavený platný digitálny podpis pre formulár (a teda, či bol formulár odoslaný). Ak
nie, prejde sa na bod 3, kde sa zistí, či pre daný identifikátor existuje v tabuľke
záznam. Ak áno, vygeneruje sa formulár podľa šablóny a to s údajmi z DB (systém
nastaví príznak stavu na FORM_EDIT), ak nie, vygeneruje sa prázdny formulár
(systém nastaví príznak stavu na FORM_BLANK). V prípade, že je nastavený správny
digitálny podpis, systém skontroluje každú odpoveď pomocou programátorom
definovaných funkcií (bod 4). Ak nebola splnená aspoň jedna podmienka, formulár je
vyhodnotený ako nesprávny a je vygenerovaný podľa šablóny (použijú sa značky
MARK, NMARK a podobne) a to s naposledy odoslanými údajmi (systém nastaví
príznak stavu na FORM_ERROR). V prípade, že formulár prešiel testom správnosti,
prejde sa na bod 5, kde prebehne zápis do databázy (systém nastaví príznak stavu na
FORM_OK). Každý krok sa robí samostatne, to znamená, že programátor má plnú
SecuFORM – webform PHP Framework 211

kontrolu nad systémom, kedykoľvek si môže zistiť stav, v ktorom sa systém nachádza
a urobiť potrebné kroky.
Vytvorenie objektu SecuFORM( pripojenie šablóny,predanie handle na
databázu, názvu tabuľky a identifikátora riadka. Načítanie vstupných
premenných (POST) 1

Je Vygeneruj vnútorné
nastavený nie Je v DB nie štruktúry a prázdy
správny digitálny záznam pre formulár
podpis? daný ID?
3
2
áno áno

Spĺňa Vygeneruj formulár Načítaj dáta z DB,


vstup dané nie
s odoslanými dátami vytvor podla nich
podmienky? a “označ chyby formulár, vytvor
podľa šablóny” vnútorné štruktúry
4
áno

áno Modifikuj riadok s


existuje v DB
daným ID podľa
záznam pre daný
odoslaných údajov
ID?
5
nie Vytvor riadok podľa
ID a naplň ho
odoslanými dátami

Obr. 1. Spracovanie formulára

2.6 Bezpečnosť

Systém používa pre názvy premenných vo formulároch náhodne vytvorené reťazce


(hash), ktoré sú uložené vo vnútorných štruktúrach objektu spolu s prepojením na
reálne názvy premenných. Náhodne vytvorené názvy premenných sa menia po každej
manipulácii s formulárom. Formulár je ďalej podpísaný meniacim sa digitálnym
podpisom, čo znamená, že daný formulár je možné odoslať iba raz. Pri vkladaní údajov
do databázy sa robia všetky potrebné opatrenia, aby sa predišlo nelegálnemu vkladaniu
databázových požiadaviek (SQL query injection) a aby sa zachovala maximálna
integrita dát.

3 Záver
Framework SecuFORM prináša kompletné riešenie v oblasti spracovania webových
formulárov v prostredí skriptovacieho jazyka PHP. V súčasnej dobe je nasadený
v niekoľkých intranetových aplikáciách a v rozsiahlej internetovej aplikácii (počet
212 Ján Šarmír

užívateľských vstupov prevyšuje 300), ktorá slúži vedeckým pracovníkom


a inštitúciám EU (http://cera.sarc.sk). Systém je v štádiu vývoja a dopĺňania nových
funkcií, zvyšovania počtu štandardných testovacích funkcií pre vstupy a podobne.
Systém je natoľko flexibilný, že pri malom zásahu si môže programátor jednoducho
pridať svoje vlastné testovacie funkcie, ktoré napríklad budú schopné testovať vzťahy
medzi jednotlivými položkami formulárov.

4 Použitá literatúra
1. Atkinson, L.: Core PHP Programming. 3rd Edition, Prentice Hall PTR, 2003.
2. Converse, T., Park J., Morgan C.: PHP5 and MySQL Bible. Wiley Publishing, Inc.,
2004.
3. Hernandez, J.M.: DB Design for Mere Mortals - A Hands On Guide. Addison
Wesley, 2003.
4. Horn, J.V.: MySQL Essential Skills. McGraw-Hill/Osborne, 2004.

Annotation

SecuFORM – webform PHP Framework


This work focuses on problem of processing broad web forms, with respect to processed data
security and form interfaces creation simplicity in forming outer and inner relationships.It is
designed for small as well as large projects with arbitrary amount of data.Central aggregation of
data, which defines forms and their interconnection, provides an easy manipulation and
continual overview of development. For this reason a new formating language similar to
XHTML, connected with logical functions, has been designed.For developers there is an object
that covers basic functionality also with ability to save, upload and modify the data using
database interface. It gives developers a free hand to create or modify the system with their own
functionality through the definition of higher-level relationships and this way change the
behavior of the entire framework. Compare to other products the most significant advantage of
this solution is its flexibility and minimal restrictive behavior.
A Conceptual Guideline to Design
an Information System for
Smart History Project
Marek GREGOR, Ondrej MIKITA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
marek.gregor@gmail.com

Abstract. In this paper we present our results from Smart History


project workshop, organized by Cinque Terre National Park in Italy in
February 2005. Project objectives are aimed towards preserving the
cultural heritage of certain types of landscapes and regions. Our
contribution consists of developing a conceptual design of information
system that would help to preserve and to improve park’s information
services for the visitors. We are trying to come up with a model
solution that would be suitable for any national park dealing with
similar problems.

1 Introduction
Preserving the cultural heritage of landscapes and regions is interdisciplinary and
complex mission, driven by professionals specialized in several ways. The Smart
History project [1] was developed in the field of four disciplines: environmental
design, agriculture and forestry, tourism and economy, communication and education.
Our contribution concerns the area of communication and education, preferably the
question: „How can communication technology contribute to preservation of cultural
heritage and responsible tourism development in the Cinque Terre [2] area“.
Our work can be divided to two parts. Firstly there is effort to provide general
guideline to design of information system independent on specific conditions related to
park. This recommendations model should be applicable to any national park, which
cultural heritage has to be protected. Second part of contribution is related to specific


Supervisor: Ing. Ivan Kapustík, Institute of Informatics and Software Engineering, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 213-218.


214 M.Gregor, O.Mikita

solutions of improving the quality of communication system in Cinque Terre National


Park.

2 Guideline to design national park information system


Before discussing the general model of information system for national parks, it is
important to realize what the term “information system” means in conditions of
national park. In this case we can define information system as internally consistent set
of resources, people and methods organized for collecting, processing, transmitting and
disseminating of information related to park, its inhabitants, employees and visitors.
It takes refinement of following questions in proper research disciplines to build a
model of such an information system:

1. What is the aim of parks strategy on development (tourists, inhabitants,


territory etc.)?
2. Who are park's involved people and what is their profile?
3. What information is available and what is yet to be researched?
4. What is the communication strategy to be used for different groups?
5. What kind of communication tools (seminars, magazines, practical exercises,
ICT, etc.) is most appropriate?

Surely answering these questions doesn’t produce final, most appropriate


information system proposals. This proceeding represents only good pre-requisite to
design suitable information system. Process of developing and maintaining consistent
set of design recommendations is never-ending, continuous activity. Our guideline of
this process is therefore based on iterations. Every iteration output is increment to
whole design of system, helping also to better answer mentioned questions.
A conceptual guideline to design an information system for Smart History project 215

Change in park
Initial park requirements and
requirements Research, discover priorities
strategy

Find the appropriate Newly found information


information

Specify the tools Newly identified tools


and technology

New
possibilities of
Educate involved education
people

Make a summary
of results achieved

Fig. 1. Guideline to design an information system for national park

Proposed guideline to design national park system is shown in figure 1. Guideline


consists of set of discrete consequent steps of incremental manner. The end of whole
iteration represents the activities related to obtaining and processing feedback with
possibility to update or increment specified part of process. We based this guideline on
the principles of gathering and analyzing information that are discussed in [3].

2.1 Research, discover strategy

Initial step deals with collecting requirements and defining their priority related to
importance for park. Using these requirements it is possible to build general strategy
for park - to specify important, concrete directions and visions for park achievable by
an information system. So the process contains gathering the applicable information
from many resources. We can mention investigation of the tourist’s profile, involving
local community in the process of collecting information specifically about their
cultural heritage, or organizing workshops to address and evaluate problems reviewed
from third parties. Essential information can be also gathered by partnerships with
various universities or scientific centers specialized to certain discipline related to
park’s heritage (e.g. forestry, agriculture) or to essential activities (economy,
marketing).
216 M.Gregor, O.Mikita

2.2 Find the appropriate information

Second step is to identify essential information and extract them from gathered
resources. This can be achieved by many approaches, e.g. using data mining techniques
can be advantage. With respect to strategy of park, defined in previous step,
researchers should concentrate on specific areas of information. For example if one of
important aims is to build better prosperous park using a communication technologies,
then there is a demand to reveal new economically progressive services for visitors. It
is hardly realized without analysis of tourist’s profiles and needs. The meaningful
information that is found can be categorized in many ways, and also exchanged with
partners (parks, universities, specialists, international organizations, etc.).

2.3 Specify the tools and technology

If recognition of supporting information related to specific park’s intentions is finished


in current iteration, it is time to start the process of tools specification, technologies and
relevant activities chosen to implement the strategy and visions specified in first step.
In this case it is also important to evaluate and coordinate existing tools. This phase can
be accomplished with a support from third party companies e.g. specialized in design
of information systems, specific technical solutions or technologies.

2.4 Educate involved people

There are many reasons for importance of educating involved people. It is essential to
inform local people influenced by this process about the decisions being taken,
especially inhabitants and park personnel, but it is not stand-alone satisfactory activity.
Correct attitude combines education and getting feedback from involved people, their
opinions and suggestions to the process of park development. Main purpose of this
phase is to help inhabitants, park’s employees and visitors to build their attitude in
harmony with the park's strategy for development. This can be realized by creating
belief of inhabitants to share their cultural heritage, extending their knowledge about
their past and the vision of their future. In order to improve quality of services,
extensive education of park personnel is important, e.g. by increasing their language
skills. Finally it is necessary to provide visitors with sources of educational material in
specific form in order to establish the responsible attitude to park.

2.5 Make a summary of results achieved

Up to now we were talking about strategy definition, finding appropriate information,


specifying solutions via tools and technologies to accomplish our strategy and
education of people. After making decisions and actions related to information system
design it is desirable to process feedback and evaluate all decisions and actions. This
phase represents final step of process iteration, continuous evaluation of the whole
A conceptual guideline to design an information system for Smart History project 217

process and comparison with expected results. Process should be adapted according to
results of the evaluation. After first process iteration, information system development
may start continuously with coordination following iterations.

3 Information system for Cinque Terre National Park


During Smart History workshop we initialized design process of information system,
using process model mentioned above. To present all achieved results about
information system is not in scope of this report. Thus we introduce gathered initial
information about aims of parks strategy using information system and secondly brief
view on conceptual design of planned information system.
Main aims related to general park’s strategy involve following points: Attract and
educate responsible tourists (agriculture, architecture, cultural heritage, history, nature,
etc.). Spread tourists throughout the whole area of the park, avoiding overcrowding of
exposed places of park, securing damaged parts of cultural heritage and helping
complete revitalization of park. Offer interesting activities for different groups of
tourists via their profile. Improve the quality of life for local inhabitants, inform about
opportunities for them in order to increase motivation to stay in the area.

Fig. 2. Conceptual design of planned information system


for Cinque Terre National Park

In context of general park’s strategy we will specify parts of proposed


information system for Cinque Terre National Park. Every part represents specific
medium or approach to storing, processing, or disseminating information in both
digitalized and non-digitalized form. Paper support contains all newsletters, brochures,
posters, tourist guides and maps, scientific or other publications. Footpath information
tables created from weather resistant media inform about interesting places and tourist
accessible landscape points. CD and DVD support can be used in order to deliver
multimedia information including 3D presentations, interactive exercises or interactive
218 M.Gregor, O.Mikita

virtual guides. Nowadays camera system monitors coastline places, which can be seen
using local cable TV. Inform visitors utilizing often updated website is easy way how
to spread interest of new potential visitors. E-learning courses comprise volumes on
environmentally related subjects, including agriculture, architecture, history,
technology, health, tourism, economics, and alternative energy, intended to raise level
of responsible tourism, used by tourists, professionals or locals who want to refresh
their knowledge in a particular field. The Cinque Terre Card gives the possibility to
subscribe all of the principal services, for certain period of time and number of persons.
This is the way how it is possible to count number of visitors. Park is trying to use new
technologies to support education of tourists. One of progressive ways is to utilize
Pocket PC - showing actual position of tourist on display also with some additional
information about the surrounding objects (points of interest). Multimedia points
should show interactive information about landscape and alternative tourist paths near
their positions. Last subpart is proposal of Management Support System as a computer
aided integration for better communication and cooperation between nature
management, agriculture and tourist organization. Data of this system should be
connected in GIS environment.

4 Conclusions
Participating on Smart History project provides experience of real-world project with
all of its difficulties. Project analysis shows fundamental problem in implementing
information system (preferably Pocket PC part) without solid base of requirements.
Due to these circumstances our contribution was concentrated on problem of designing
the information system with help of requirements gathering, specifying strategy and
finding relevant information.

Acknowledgement: This work was supported by the Smart History project members
from University of Firenze (Italy), Hogeschool Antwerpen (Belgium), Poland Open
University Cracow (Poland) and we would like to thank them this way. Also we would
like to thank the EU committee and coordinators, this project would never succeed
without their effort.

References
1. Smart History Project, http://www.smarthistory.it
2. Cinque Terre National Park Official Website, http://www.parconazionale5terre.it
3. Bieliková, M.: Softvérové inžinierstvo: Princípy a manažment. STU Bratislava,
2000. ISBN 80-227-1322-8.
Spatial Planning Support
Marek GREGOR, Ondrej MIKITA∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
marek.gregor@gmail.com

Abstract. The presented thesis deals with the concepts of computer


support for the complex processes of spatial planning, which include
collecting and analysis of large amounts of data. Spatial planning is a
very complex and difficult problem. Our goal is to identify the part of
problem connected with it and then try to create a prototype to solve
the identified problem. In this work we identified several basic
problems connected with spatial planning processes on the Faculty of
Architecture, Slovak University of Technology. We analyzed several
problem areas and their possible solutions. We decided to focus on the
problem of creating interactive maps based on WMS and WFS
technologies.

1 Introduction
Spatial planning is one of the most important processes nowadays. It is connected with
almost all kinds of human activities starting with urbanization and ending with
economy. It takes a lot of information to come up with a good spatial plan. This
information includes geographical as well as non-geographical data. What are non-
geographical data in this process? For example we are dealing with the laws,
economical data, demographical data etc.
These information were collected for many years and the problem therefore is to
find the relevant data in this amount of information. In global European point of view
this becomes even more important, because every country may have a lot of
information. The information is stored and maintained in Geographical Information
Systems (GIS). Unfortunately these information are stored in different databases, in
different formats and with different onthologies. Today, when Europe is trying to unite
it is no surprise that the cooperation is needed in the area of spatial planning. One of


Supervisor: Ing. Ivan Kapustík, Institute of Informatics and Software Engineering, Faculty of
Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 219-223.


220 M.Gregor, O.Mikita

the projects that deals with this cooperation is called Central European GIS [4] and
together with Faculty of Architecture of Slovak University of Technology we were
taking part in it.
In our work we tried to identify possible ways of the spatial planning support and
to analyze their possible solutions. Afterwards we picked one of them, analyzed it
thoroughly and now we have started to design a solution for it. We identified and
analyzed following problem areas.
First problem we identified was the problem of unifying the heterogeneous
environments of different geographical information data stores within the CEGIS
project. This project’s main goals are aimed on solving the ontological heterogeneity of
national GIS systems and on providing centralized information service for spatial
planning purposes available on the Internet.
Second problem we identified is the problem of interactive map creating. The idea
is to offer a tool for users which they would use for generating layered maps on
demand. It means that a user requests a map with certain geographical features like
roads, railways, rivers, demography, temperatures etc. within certain geographical area
and server will create this map for him from the information data store it owns or has
access to. This map is extended with non-geographical data about these geographical
features which helps user of such map to interpret data provided by it. In our opinion
this technology offers a very good support for spatial planning and that is why we
decided to work on this idea.
After analyzing status quo in this area we found out that there has been a lot of
work put into it by OpenGIS consortium. They developed a series of de-facto standards
based on XML that are used widely in area of GIS. First of them is called Geography
Markup Language (GML) and it is used for creating application schemes describing
geographical features. Then there are Web Feature Service (WFS [2]), Web Mapping
Service (WMS [1]) and Styled Layer Description (SLD [3]) standards. These standards
describe services used to generate and distribute maps. You can imagine a system
based on these standards like a standard 3 tier system where data layer is provided by
WFS server, application layer by WMS server and presentation layer by clients. There
are several implementations of these services and we chose to use one of them and
improve it’s functionality in order to provide an integrated solution for spatial planning
support purposes. The implementation we chose is an open source project called
GeoServer. It implements WFS and WMS with SLD and in next chapters we will
describe our new features.

2 WMS and clients


Before we start talking about WMS it is important to introduce background about
approaches which type of information can be accessed by client software. In general
there are two possibilities, clients can obtain raw geo data or already generated maps.
This dividing implies fundamental differences between WFS and WMS services.
WMS server produces static image – map – as a response to specific user request,
which contains geographical boundaries of requested area, specified layers visible in
Spatial planning support 221

image and information helping to specify particular demand. Format of request is


defined by OpenGIS consortium standard and is based on XML language [1]. In
principle WMS server generates this map from geo data obtained primarily from WFS
server. This solution has a great outcome to client, because it doesn’t need to generate
map as a visible result for user from geo data. On the other hand the static image
doesn’t contain geographical data, needed in many occasions. Therefore the Web Map
Service defines concept how to get geo data from specific part of generated map to
client. Implementation of this feature, removes the disadvantage of using static image.

Fig.1. Conceptual scheme of proposed system

Nowadays many desktop applications implement the client side of WMS, but
there is lack of WMS clients on mobile devices like PDA or smart phones. Our
contribution is aimed on creating a WMS client on PDA device. Due to limited
memory and computational power we decided to implement client part which obtains a
map generated at the server side. Client will be implemented in Java Personal Profile,
connection to server is wireless via HTTP protocol. Supported maps formats are raster
formats png, jpeg and vector format svg. Conceptual diagram of complete system is
shown on Fig. 1.

3 WFS and geographical data


What is a WFS server? It is a server that WMS server contacts in order to obtain
geographical data. It represents an interface between actual source of data and WMS
server. The data source can be represented by any suitable object (database, file).
WFS server implements unified interface for gathering requests from WMS
server and sending the responses to appropriate WMS server [2]. As we said earlier
these servers are already implemented and there are also open source implementations
that we can use. Where is the problem on this side of map processing?
The problem is data. In order to be able to produce maps, the server needs lot of
geographical data in its database. Basically we can say that there has been a lot of
information collected in previous years. But these data have to be stored in appropriate
format in order to be able to access and use them. That is why it is necessary for the
WFS server to implement unified interface for accessing the geo data stores. This
interface allows user to implement a plug-in for GeoServer that extends GeoServer’s
data access capabilities. The WFS part of GeoServer can be connected to any data
source, that user needs. However, from the performance point of view the best option
222 M.Gregor, O.Mikita

seems to be to use the GIS enabled relational database. Nowadays almost all major
SQL Server providers offer a GIS enabled solution. What does GIS enabled mean?
This kind of database supports special kind of tables and functions that provide special
data types for storing geographical features. Every geographical feature type (road,
bridge, building etc.) is represented by a table in a database and every feature of given
type is represented by a row in a table.
Geographical feature is described by its geographical location and on the map
even by its shape. For example road is described by some kind of polyline, lake is a
polygon etc. Location can be represented in many different coordinate systems.
Therefore the GIS enabled database has special data types to store information about
shapes and coordinates. In addition it provides function, that enable user to write SQL
statements that directly search for largest city, longest road, etc. This functionality
gives such a database a big advantage over simple database. The GeoServers WFS can
take advantage of this performance, but in order to be able to do so, it needs a data
source that supports these features. As we mentioned before there are some GIS
enabled databases available. One of them is also an open source project and it is based
on Postrgre SQL. It is called PostGIS and it is implicitly supported by GeoServer.
Once we identified the proper data source for WFS server, we need to feed all the
collected data into it. This seems to be a major problem, because the data collecting
could take a lot of years and the formats in which they are stored can be different.
Again, we think it is necessary to unify the data formats, because it is much easier and
cheaper to maintain only one data source. In further work we would like to concentrate
on this problem.
Objective is to build an application that would act like a data converter from
different formats to a database. In addition it must provide an interface that would
support plug-ins for new data types to be converted so it is easy to extend its
capabilities. On the other end of this data converter there should be an interface that
would connect to any data source that user specifies in order to be compatible with
most of the database servers or other data stores. Fig. 2 shows this architecture.

Fig. 2. Detailed view on data migration to WFS data source


Spatial planning support 223

The WFS server maintains even a database of styles for every feature type. Style
describes the visual outlook of the feature. For example road can be represented as a
black line with the width of 4 pixels. That means that the data converter should provide
also a user friendly interface for registering a new style for new feature type. After user
selects the outlook of a feature type, the application creates an XML file that is
compatible with mentioned format SLD and registers it in WFS server.

4 Conclusions
This paper is a brief look into our solutions to spatial planning support. We are
currently working on a GIS system that could be a prototype solution for information
sharing and distributing on PDA mobile devices. The advantage of this solution is that
it is based on well specified open formats and on open source projects. This enables us
to deliver a first prototype that covers the whole area of map generating in relatively
short time. It is also a solution that is widely supported by the geographical community
and therefore it is highly probable that work on this system will continue in the future
and that it will deliver solution that will fulfill the needs of spatial planning in central
European territory.

References
1. Open Geospatial Consortium: Web Map Service Specification
http://portal.opengis.org/files/?artifact_id=5316 (5.4.2005)
2. Open Geospatial Consortium: Web Feature Service Specification
http://portal.opengeospatial.org/files/?artifact_id=7176 (5.4.2005)
3. Open Geospatial Consortium: Styled Layer Description
http://www.opengeospatial.org/docs/02-070.pdf (5.4.2005)
4. Central European Geographical Information System MetaDataBase project
http://gis.cvut.cz/index.php?id=101&lang=cz (5.4.2005)
Modules of Content Management Systems
and their Reusability
Michal JAKUBÍK∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovak republic
michal.jakubik@ae-design.sk

Abstract. There are a lot of theories about reusability of parts of


information systems. Narrower sphere of reusability of software
components is websystems module reusability and concrete using
done modules of content management systems. And where are the
bounds of using components with content management systems? What
are advantages and disadvantages of reusability components of CMS
to generate front end designs and how to prepare component to make
it easy to reuse. All these questions are very subjective and not easy to
answer.

1 At the beginning
In the context of reusability we should distinguish reusability in websystems and
websites. When you are creating website, first thing you have to create for your
customer is a graphic layout. In this phase your client says “OK, start working”. Now
begins phase of your developers.
There are two possible views of reusable templates. Graphic template and its
reusability is a little bit hard to reuse, because every costumer wants to have original
layout and original styling of his website or intranet websystem.


Supervisor: RNDr. Valéria Šimáková, Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 224-228.


Modules of Content Management Systems and their Reusability 225

2 Templates
2.1 Programming template

Programming template is something different. Here are modules that are always used
and you can use this template every time and on every project.
For example let’s talk about menu. In every application there have to be menu.
Without menu is the application and especially websystem unusable. Concerning to the
website, simply said, the menu is listing of all available and accessible sites and
subsites of your web.

Fig. 1. Part of sitetree of website

When you have more languages in your web, alternation of sites-listing in levels
is required. When you created a complex template for creating the sitemenu you won.
Because if in your complex template you separated generating front-end part (HTML
code) and logical part - database queries and their processing, reusability of this
module is finished. When you want to reuse this module you just copy logical part and
front-end part will be changed and styled another way.
The next example that is in CMS systems used very often. This module is news
content part. The logical functionality is here nearly every time the same. Here is valid
the first rule of reusability of modules – separate front-end part from logical part. In
modules like news or events there are sometimes needs to change logical or database
part, because every costumer wants to store another data or a little bit other
functionality. But mostly changes are not bigger than add one column into database
and generate this column on front-end.
226 Michal Jakubík

On every CMS site there you can always find module called sitemap. This
module generates list of structured names of sites and subsites.

Fig. 2. CMS sitemap module in default language

In default language there are names in default language – in this case there is
German. But most of sites there are more than one – default languages. On this site
there are two languages. The second one is English.

Fig. 3. CMS sitemap module in English

This case is very similar to the module menu. The same is logical functionality,
different is only HTML code. What will happen when we use the same module to
generate menu and sitemap? The answer, in this case, is nothing. When our menu
Modules of Content Management Systems and their Reusability 227

module is done really completely, you have to create only a HTML class that calls
logical part (classes) of module implementation. So the reusability of module is here
completed twice. Because there are two functionalities in one project for nearly zero
costs (the costs of reuse development).

2.2 Graphical template

And what about development of graphical template of a website? The whole website in
most cases we can shift into 4 parts. The top, menu (mostly on left site), the content
part and footer. In the top there is a transcription image. When in the top part there is
defined functionality then it is mostly only an image changer. The menu part is
described by its name – menu part. In the content we can find all information of the
website and the footer is some kind of menu which is not included in menu part. This is
word described graphic template of most websites. This is easy to implement in HTML
with place holders of functionality.

Fig. 4. Classic HTML template


228 Michal Jakubík

Instead of place holders will be generated functionality. For example placeholder


for menu module is “<!-- ###MENU### -->”. The CMS parser takes the template
and these places will be replaced with code which is generated by module. If we want
to create another project with the same layout (not styling) we will use this template
and the only thing to change will be css file and the top image. This way is cheaper
than to create a new HTML code for whole template and we are 100% sure that the old
template was optimized for alternate browsers.

3 Conclusions
Finaly the result is that the well made template is useable every time. Possibly one
template is useable in one project twice or more times. Functionality of one module
can be used more than once. The best case is when the template is made complex and
universal and the possibility of resell to another costumer is high. Difference between
programming template and graphical template is only in multitude of usability. You
cannot use one graphical template in one project more than once.
So why don’t we reuse components by websystems too? It spares time and
money.

References
1. Cohen, M.: Typo3 Template Basics. 2003.
2. Skårhøj, K.: Modern Template Building (Part 1). 2003.
http://typo3.jweiland.net/uploads/media/Modern_Template_Building__Part_1.pdf
3. Skårhøj, K.: Modern Template Building (Parts 2 and 3). 2003.
http://typo3.jweiland.net/uploads/media/Modern_Template_Building__Part_2-
3.pdf
4. Skårhøj, K.: TypoScript reference. 2002.
http://www.mgwebservice.de/uploads/media/TSref.pdf
Recommender System for Adaptive
Hypermedia Applications
Andrej KRIŠTOFIČ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
kristofic@zoznam.sk

Abstract. Most adaptive web-based hypermedia systems adapt pres-


entation of the content and/or navigation using predefined set of rules.
Considering different behavior and preferences of each user it may be
hard to generalize and construct all appropriate rules in advance. In
this paper we explore this problem in context of educational adaptive
hypermedia systems. We focus on recommending lessons (learning
objects or concepts) that students should study next while using adap-
tive hypermedia system. We present architecture of a web-based re-
commender system, which uses results of knowledge discovery to im-
prove adaptation.

1 Introduction
Adaptive hypermedia systems have become popular in last few years in many applica-
tion areas such as educational hypermedia, on-line information systems or information
retrieval hypermedia [1]. Adaptive hypermedia application in the field of educational
systems is natural, as each student generally has different characteristics related to
learning, so an adaptation to the student’s characteristics can help the student to master
topics more effectively.
However, it is quite difficult for an author of the course to develop appropriate
adaptation model. This requires respectable knowledge of students’ behavior to create
such adaptation rules, which will result into an effective adaptation of presented
knowledge together with appropriate navigation in the course information space. We
propose to use knowledge extracted from educational adaptive hypermedia system by
means of knowledge discovery for the adaptation model improvement.


Supervisor: doc. Ing. Mária Bieliková, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 229-234.


230 Andrej Krištofič

In this paper we present a recommender system, which employs knowledge dis-


covery for purpose of finding patterns of a characteristic behavior of students from data
collected by the adaptive hypermedia educational system. Discovered patterns are used
in the process of recommendation of relevant concepts to students, mainly for curricu-
lum sequencing.

2 Navigation recommendation approaches


Following discovered patterns various approaches have been proposed for navigation
recommendation (global or local, direct or indirect guidance). In [5] authors have pro-
posed to conduct the recommendation directly with discovered patterns. Active user
session is used to search the patterns and find the matching ones. Suffixes of these pat-
terns become candidates for the recommendation. Only the most recent part of the ac-
tive user session is used for matching.
Another approach [4] is aimed to group stored user sessions or discovered fre-
quent item sets into session clusters using techniques of clustering. Representative us-
age profile is computed for each cluster. Active user session is then matched against
computed usage profiles.
Mentioned approaches deal with one kind of patterns and provide support for this
specific kind. We propose using several kinds of patterns (e.g., sequential and traversal
patterns) distinguished during the process of recommendation and describe software
framework for a recommender system, which extends architecture of adaptive web-
based hypermedia applications. Properties of used patterns and methods for discover-
ing them are discussed in greater detail in [3].

3 Recommender system for adaptive hypermedia

3.1 Recommender system architecture

Proposed recommender system as a back-end for an adaptive hypermedia system is


based on modular software architecture. The software architecture (see Figure 1) fol-
lows the flow of two main processes carried out in the system: (1) knowledge discov-
ery and (2) concept recommendation.
The system is designed to be independent of underlying adaptive hypermedia ap-
plication as much as possible. Therefore the architecture incorporates a wrapper, which
acts as a facade between an adaptive hypermedia system and the recommender system
itself. This approach allows using various adaptive hypermedia systems as sources of
data for knowledge discovery without modification of the recommender system itself.
Wrapper. All the adaptive hypermedia system dependent tasks are performed in
the wrapper module. This includes usage data retrieval as well as tasks related to the
processing and deploying generated adaptation rules, and the user model update. Using
the recommender system with several adaptive hypermedia systems requires a wrapper
Recommender System for Adaptive Hypermedia Applications 231

Recommender
System Data Mining

Knowledge Knowledge
Database
Base Presentation
Author

Data Rule Recommender


Preprocessing Generator Module

Wrapper

Authoring
Adaptive Hypermedia System
Tool

data flow
User Author

Fig. 1. Architecture of recommender system.


module for every adaptive hypermedia system. This module forms also the interface to
an authoring tool, where adaptation knowledge is defined by the author.
Data preprocessing. The data preprocessing module takes the stream of user ac-
tions as its input. These actions are preprocessed and searched for potential errors and
inconsistencies. The module also takes care of identification of user’s sessions. Ses-
sions are filtered according to their length (short sessions are dropped) and/or overall
knowledge level of respective user. Finally, the module stores sessions into database of
the recommender system.
Data mining. In the data mining module various algorithms for pattern mining
(see [3]) are applied on data stored in database. Traversal patterns, sequential patterns
and association rules are discovered using different views on data (e.g., different levels
of concepts in domain hierarchy, concept types). Discovered patterns are stored into
the knowledge base.
Knowledge presentation. The main purpose of the knowledge presentation mod-
ule is to present selected discovered knowledge (e.g., association rules) to the author of
a course. The author can then make modifications to the domain structure and the con-
tents of the information fragments.
Rule generator. The task of the rule generator module is to construct static adap-
tation rules (i.e., rules where current learning session of a student is not considered)
based on patterns in the knowledge base. These rules are deployed to the adaptive hy-
permedia system through the wrapper.
232 Andrej Krištofič

Recommender
AH System
User System Author
action
(e.g. display concept)
A log
action

retrieve usage data

preprocess data
B
find and store
patterns

display concept recommend


relevant concepts
find matching
patterns
C return recomm. find relevant
concepts concepts
display concept annotate
with list of recomm.concepts
recomm. concepts

display knowledge
display stored
patterns
D
modify course content

Fig. 2. Typical scenario of the recommender system usage.


Recommender module. The recommender module creates a sequence of recom-
mended concepts based on the current session of a user and the knowledge stored in
the knowledge base. The concepts in the current user session are matched against the
ones in patterns of the knowledge base. When appropriate (similar) patterns are found,
the concept recommendation is carried out. The result is a sequence of recommended
concepts and the evaluation of their suitability and relevance for the user. This se-
quence is generated on demand of the adaptive hypermedia system (each time the user
moves to another concept or fragment, or after some time period or at the beginning of
each session).

3.2 Use case scenario

Sequential diagram in Figure 2 describes typical usage scenario of proposed recom-


mender system. While users work with the adaptive hypermedia system, it logs and
Recommender System for Adaptive Hypermedia Applications 233

stores all their actions (e.g., logins, logouts, concept visits) (see part A in figure). When
scheduled, the recommender system retrieves usage data, preprocesses it and stores it
into database. Data mining algorithms are executed on stored usage data and usage pat-
terns are discovered and stored in the knowledge base (see part B in figure).
With knowledge base filled up, the recommender system can recommend a se-
quence of relevant concepts for particular user, when asked to do so. An adaptive hy-
permedia system provides the recommender system with the user identification and his
current session and the recommender system returns recommended sequence of con-
cepts, which the user should visit next. The adaptive hypermedia system may annotate
concepts in the sequence according to suitability evaluation provided by the recom-
mender system (see part C in figure).
When author of the content decides to improve it, visualization of discovered
knowledge can help to decide which modifications should be made. The author can
also compare historical records and evaluate the effect of his previous changes to the
adaptive hypermedia system content (see part D in figure).

4 Experiments
To verify our approach to knowledge discovery in adaptive web-based hypermedia we
developed a prototype of the recommender system. We implemented three data mining
algorithms for pattern discovery (traversal patterns, sequential patterns and association
rules) suitable for educational hypermedia applications.
Results of the knowledge discovery are markedly dependent on source data. We
chose the ALEA educational adaptive hypermedia system [2] for our experiments since
we have had available usage logs gathered during 3 years of its usage in the Functional
and logic programming course. At time of experiments the database contained 1 170
sessions.
Experimenting with the ALEA data, we found out that even though algorithms
find some patterns in the data, these patterns have quite low support (around 15%). To
outline this fact, we analyzed and visualized visits of individual concepts as well as the
navigation between them. We discovered that all visits are almost equally distributed
between all concepts. There were only slight trails of increased navigation between
certain concepts. This issue may be caused by the restricted way the ALEA system was
used. The primary goal of students was not to master whole domain but to prepare
themselves for a programming test. The second reason may be the existence of a guid-
ance that the ALEA system already offers. We suppose that direct guidance imple-
mented in the ALEA system (by means of the “Next” button) influenced such students’
behavior and was proved in this way as appropriate.

5 Conclusions
The adaptation in most of current educational adaptive hypermedia systems is driven
by a fixed set of rules. The construction of such rules is a complex task and the author
may not be able to completely assess all intricacies found in different learning styles of
234 Andrej Krištofič

students. Techniques for data mining can provide knowledge needed either to recom-
mend students concepts according to their characteristics or to assist the author of the
course to improve the structure of the domain.
Main contribution of this paper is proposal of the recommender system, which is
based on an idea of adaptation model development using data mining techniques. It
connects the process of knowledge discovery with on-line recommendation of concepts
based on discovered knowledge. The architecture of system allows using different un-
derlying adaptive hypermedia systems, enabling us to share common knowledge (not
specific to certain adaptive hypermedia system and its content). The architecture also
incorporates the module for visualization of discovered knowledge helping the author
of the course to prepare modification to the content.
In our approach, association rules, sequential patterns and traversal patterns repre-
sent automatically generated knowledge about students’ behavior. Based on a student’s
current learning session and discovered patterns, the recommender system is able to
recommend a sequence of concepts, which the student should study next.
Future development of the recommender system will focus on enhancing the set
of data mining algorithms, e.g., to use clustering techniques in order to discover user
clusters according their learning style. We plan to evaluate quality of recommendations
carried out by our recommender system using data produced by other educational hy-
permedia systems. The evaluation will be based on a feedback from students as well as
on results of the recommendation performed on a testing set of data.

Acknowledgement: This work was supported by Science and Technology Assistance


Agency under the contract No. APVT-20-007104.

References
1. Brusilovsky, P.: Adaptive hypermedia. User Modeling and User-Adapted Interac-
tion Ten Year Anniversary Issue, 11, 1/2 (2001), 87-110.
2. Kostelník, R. - Bieliková, M.: Web-based environment using adapted sequences of
programming exercises. In: Proc. of Int. Conf. on Information Systems Implemen-
tation and Modelling, M. Beneš, Ed. (2003), 33-40.
3. Krištofič, A. - Bieliková, M.: Improving adaptation in web–based educational hy-
permedia by means of knowledge discovery. Submitted to: HT 2005 – Sixteenth
ACM Conference on Hypertext and Hypermedia.
4. Mobasher, B. - Cooley, R. - Srivastava, J.: Automatic personalization based on
web usage mining. Communications of the ACM 43, 8 (2000), 142-151.
5. Mobasher, B. - Dai, H. - Luo, T. - Nakagawa, M.: Using sequential and non-
sequential patterns in predictive web usage mining tasks. In: Proc. of the IEEE Int.
Conf. on Data Mining (2002), 669-672.
Improving Adaptive Hypermedia by
Adding Semantics
Anton ANDREJKO∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovak republic
andrejko@fiit.stuba.sk

Abstract. Recently the Web and its services have changed the way of
thinking about them; hereby expectations have changed, too. While in
recent times users have been satisfied with presentation of generic
information, nowadays they are asking for personalized information,
which are adapting to them. This kind of presentation is not sufficient
in the information acquiring from databases on the Web. It is needed
to append metadata to this information. Metadata express semantics
and makes the information easier for computer processing. This paper
presents models for adaptive and semantic Web and shows how to
improve adaptive presentation with semantics.

1 Introduction
On the Web is the huge amount of the information, which are distributed and
structured in various levels. The user can get lost very easy in this environment or
he/she spends too much time browsing among information with not very essential
value. For this reason is needed to append a new element to hypermedia systems –
adaptation.
By adaptive hypermedia systems we mean all hypertext and hypermedia systems,
which reflect some features of the user in the user model and apply this model to adapt
various visible aspects of the system to the user. In other words, the system should
satisfy three criteria: it should be a hypertext or hypermedia system, it should have a
user model, and it should be able to adapt the hypermedia using this model [4].
Probably the most used way for accessing the information are catalogs and full-
text search engines. These only generate a result from database, which is based on


Supervisor: doc. Ing. Mária Bieliková, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 235-241.


236 Anton Andrejko

query given by the user. The search engines do not understand the presented content
and do not take care of the language flexion and context in which was the query given
by user. Ontologies are the way how to overcome differences between queries and
search results. Moreover these results could put more exactly by using adaptive
hypermedia techniques described in [4]. In next sections we describe models used in
adaptive and semantic Web. The understanding of the models is very important for
next research. The aim of this paper is to propose a new adaptive model with added
semantics. We try to find an appropriate place in adaptive model for including
semantics.

2 Modeling adaptive hypermedia systems


This section describes the evolution from the hypermedia models to the adaptive
hypermedia. Models have been developed by designers’ in various independent Web
systems. In these systems are many similar architecture aspects but they using the
different terminology. For further research we need common model and terminology
for hypertext field.

2.1 Hypertext Abstract Machine

The Hypertext Abstract Machine (HAM) was the first try to make a common system
usable for various hypertext applications. HAM is hierarchical model based on five
objects [5]: graphs, contexts, nodes, links and attributes. A graph is the higher-level
object. A graph contains information about a topic and consists from one or more
contexts. Each context has one parent context and zero or more child contexts. The
context consists of nodes and links. Nodes contain arbitrary data. These data are
conducted by links. A link defines relationship between source node and destination
node in both directions. Attributes (strings, numbers, and user’s types) can be attached
to contexts, nodes and links. Attributes give semantics to HAM objects.

2.2 Dexter hypertext reference model

The Dexter reference model is the result of two workshops. The model is an attempt to
capture, further develop, and formalize the results of these discussions. Also it tries to
find common terminology for hypertext field. Dexter model divides hypertext systems
into three layers: run-time, storage and within-component [8]. The run-time layer
describes mechanism the user’s interaction with hypertext. The within-component
layer covers the content and structures within hypertext nodes. The range of the content
or structure is not restricted. Dexter model has become the base for developing others
hypertext systems therefore it will be explained in more details.
The main focus is on storage level, which models nodes/links of the network
structure that are the base for hypertext. The storage layer describes “database” that is
composed of hierarchy of data-contained components interacted by relational links. In
different hypertext systems can be used for nodes terms as cards, frames, documents or
Improving Adaptive Hypermedia by Adding Semantics 237

articles. Dexter model generalizes the term node. Instead of the node is used the term
component. Component can consist from text, graphics, pictures or animation that
makes the main content. This layer does not distinguish between text component and
graphical component. The layer distinguishes atomic components and composite
component. Atomic components are usually nodes in hypertext systems and their
structure is the concern of the within-component layer. Composite components are
constructed from atomic components.

Run-time layer
Presentation specifications

Storage layer
Anchoring

Within-Component layer

Fig. 1. The Dexter Reference Model.

As is shown in the figure 1, presentation specification and anchoring are


interfaces between layers these layers. Presentation specifications are the mechanism
by which information about how will be component presented encoded to hypertext
network at storage layer. Anchoring is a mechanism for addressing item within
component.

2.3 Adaptive Hypermedia Application Model

In the adaptive hypermedia systems (AHS) are watched preferences and knowledge
about domain. These records are stored in the user model that helps to direct user to the
relevant information. AHS do that by dynamic adaptation links and content. AHS are
adaptive. The user can adjust some preferences explicit.
In Dexter model component covers both nodes and links. In Adaptive
Hypermedia Application Model (AHAM) [6] the central term are concept and concept
relationships. AHAM extends Dexter model with adaptation based on user model. In
this model (see figure 2), Domain model corresponds (roughly) to the storage layer in
Dexter model. The domain model comprises of the concepts. The user model describes
of which information about the user AHAM keeps a permanent record. The teaching
model consists of the rules which define how the domain model and user model are
combined to perform the adaptation.
238 Anton Andrejko

Run-time layer

Presentation specifications

Teaching model

Domain User
model model

Anchoring

Within-component layer

Fig. 2. Adaptive Hypermedia Application Model.

2.4 Munich Reference Model

This model is based on Dexter model and formally described by UML (Unified
Modeling Language). The Munich model [10] keeps three-layers structure and appends
rule-based adaptation for user aspects. The run-time layer is responsible for interaction
with the user.

Storage layer

Domain Adaptation
Meta-Model Meta-Model

User
Meta-Model

Fig. 3. The Munich reference model (storage layer).

The adaptation meta-model is appended within storage layer (see figure 3). The
adaptation meta-model consists of a set of rules that implement the adaptive
Improving Adaptive Hypermedia by Adding Semantics 239

functionality, i.e. personalization of the application. The domain meta-model manages


the basic network structure of the hypermedia system. A part of the domain meta-
model is the navigation model. This model describes possible navigation trough
information space determined by the domain meta-model [7]. The user meta-model
manages a set of users represented by their attributes. First group are domain
dependent attributes (knowledge) and second one are domain independent attributes
(preferences). Mentioned models described by UML are more in details in [3, 7].

3 Adding the semantics


Adaptive hypermedia systems are able to adapt to the user or environment but many
times are unsatisfactory for users’ expectations although they offer adapted content
and/or presentation. Users expect qualitative information with small effort. In many
cases information that are presented to the user and that had been adapted claim user’s
effort to be useful. Computers do not “understand” the presented content, therefore is
needed to add meta-data to the content for better computer-processing. The meta-data
describe only the meaning of the content. The most time-consuming user’s activity is
looking for relationships between those contents.
The problem may cause designers who can use different meta-data for describing
the same content. Shared understanding is necessary to overcome differences in
terminology. Ontologies provide a shared understanding of a domain [1]. Ontologies
are useful for the organization, navigation and improving the accuracy of the Web
search.
In present-day AHS is not described semantics of the content that is stored in
within-component layer. In this paper we describe an approach how to add semantics
to adaptive hypermedia. To get this goal it is necessary to briefly describe semantic
Web structure. Project Hera1 uses a model-driven methodology for developing
semantic web application and divides them into three layers [2]: semantic, application
and presentation (see Fig. 4).

Presentation

Presentation layer

Application layer

Semantic layer

Content

Fig. 4. The Semantic model in Hera.

1
Hera, http://wwwis.win.tue.nl/~hera/
240 Anton Andrejko

The presentation layer specifies the layout of the presented content, application
layer specifies the navigation view over the conceptual data and consists from slices
that specify the structure of navigation nodes. The core of the semantic layer is
conceptual model describing the semantics of the data content. This model is expressed
in terms of RDFS.
The two upper layers can be found in AHS. If we compare Dexter model as a
headstone for AHS to the semantic model, the run-time layer would include the
presentation layer and slices from the application layer liken to the components in the
storage layer. But models mentioned in the section 2 miss the semantics that is in
semantic layer.
Before we add the semantic layer into the adaptive model, we should note that
Hera uses personalized presentation by user preferences in application model. To
achieve adapting in Hera is used conditional inclusion of slices (fragments) and
navigation (links) hiding [9]. In adaptive hypermedia are more techniques for adapting
content and navigation [4]. Therefore we prefer adding semantics to the AHS to adding
adaptive aspects to the semantic model. This seems to be easier way to fulfill the goal –
personalized presentation with the use of semantics.
In our approach we insert the semantic layer between storage and within-
component layer (see figure 5). This layer specifies the data content. It also defines the
integration process that gathers the data from different sources.

Run-time layer

Storage layer

Semantic layer

Within-Component layer

Fig. 5. The Dexter Model with the semantic layer.

The layer creates an interface between layers and according to the user query (for
instance in Web search) by using ontology takes into account semantics of the content
and offers that content sensitive result from within-component layer to the user. The
layer expresses the semantics of the content. For describing the semantics we can use
one from ontology languages for instance RDF, RDF Schema or OWL. Any of them
seems to be useful. The selection of the appropriate language and inner structure design
is the goal for the following research.

4 Conclusions
In this paper we have described hypermedia models and adaptive hypermedia models.
We have focused on Dexter reference model that is the base for other AHS. In our
research we try to add semantics into AHS and improve the current systems. The
semantics layer proposed in this paper connects personalized adaptive hypermedia with
Improving Adaptive Hypermedia by Adding Semantics 241

Semantic Web initiative. Semantic layer improve accuracy in Web search and is useful
in navigation of Web sites. In following research we are planning deeply describe inner
structure of the semantic layer. We are also planning to experiment our approach in
prototype.

Acknowledgement: This work has been partially supported by the Grant Agency of Slovak
Republic grant No. VG1/ 0162/03.

References
1. Antoniou, G., Van Harmelen, F.: A Semantic Web Primer. MIT Press, Cambridge,
2004.
2. Barna, P. et al.: Semantical Descriptions of Models for Web Design. In: Workshop
on Application Design (2004)
3. Bieliková, M.: Presentation of Adaptive Hypermedia on the Web. In: Proc. of
DATAKON, L. Popelínský (Eds.), Brno (2003), 72-91.
4. Brusilovsky, P.: Methods and Techniques of Adaptive Hypermedia. User
Modeling and User-Adapted Interaction, Vol. 6 (1996), 87-129.
5. Cambell, B., Goodman, J.: HAM: A General Purpose Hypertext Abstract Machine.
Communications of the ACM, Vol. 31, No. 7 (1998), 856-861.
6. De Bra, P., Houben, G. J., Wu, H.: AHAM: A Dexter-based Reference Model for
Adaptive Hypermedia. In: Proceeding of the ACM Conference on Hypertext and
Hypermedia (1999), 147-156.
7. Dolog, P., Bieliková, M.: Hypermedia systems modeling framework. Computers
and Informatics. Vol. 21, No. 3 (2002), 221-239.
8. Halasz, F., Schwartz, M.: The Dexter Hypertext Reference Model.
Communications of the ACM, Vol. 37, No. 2 (1994), 30-39.
9. Houben, G. et al.: Hera: Development of Semantic Web Information Systems. In:
International Conference on Web Engineering, Lecture Notes in Computer
Science, Vol. 2722, Springer (2003), 529-538.
10. Koch, N., Wirsing, M.: The Munich Reference Model for Adaptive Hypermedia
Applications. In: Proceedings of Second International Conference on Adaptive
Hypermedia and Adaptive Web-based Systems, Springer Verlag (2002), 213-222.
An Overview of RDF Model
Representation Formats
Vladimír GRLICKÝ∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
grlicky@fiit.stuba.sk

Abstract. The Resource Description Framework (RDF) is a way how


to model ontologies (i.e. concepts and relationships among these
concepts) in the Semantic Web. Generally, RDF is a collection of
triples, each consisting of a subject, a predicate and an object. This set
of triples is also known as RDF graph (or RDF graph data model).
Besides its graphical representation RDF model can be also
represented textually. In this paper we present an overview of several
the most used formats of serialization of this model. We also mention
advantages and disadvantages of using these formats.

1 Introduction
RDF – the Resource Description Framework – is a foundation for processing metadata;
it provides interoperability between applications that exchange machine-
understandable information on the web. Although World Wide Web Consortium
(W3C) recommended as a normative representation of RDF model the RDF/XML
format, this one is not the only one representation of RDF model. In this paper we
briefly mention four currently mostly used formats for RDF model representation
(namely RDF/XML, Notation 3, N-Triples, and TriX). To demonstrate some of
features of these formats we will try to encode following two sentences: “Full name of
a person identified by http://semweb.grlicky.info/vgrlicky is Vladimir
Grlicky. The name of this person consists of given name Vladimir and family name
Grlicky“.
On this simple example we show that the same model can be represented not only
by RDF/XML, but by other alternative formats that have minimally the same


Supervisor: prof. Ing. Pavol Návrat, PhD., Institute of Informatics and Software Engineering,
Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 242-248.


An Overview of RDF Model Representation Formats 243

expressive capabilities as RDF/XML. But, before we start exploring RDF


representation formats, we briefly describe basic features of the RDF.

2 Basics of RDF
RDF (Resource Description Framework) is a standardized way how to describe
resources located on the web as well as real-world objects (e.g. a paper book, a car)
that are not directly accessible via the services of the Internet. Until 2003 RDF was
specified by only one document – Model and Syntax (M&S) Specification [10]. The
RDF M&S specification defined an abstract data model (the “Model” part of the
specification). The model is abstract because it is defined in terms of abstract
mathematical structures such as triples and sets. This specification also defined how to
represent data conforming to this data model in XML (the “Syntax” part of the
specification). RDF/XML – the XML serialization recommended by W3C is
a representation of the abstract model. However, it is important to distinguish between
the abstract data model and its representations. The specifications define constraints
which apply to the abstract data model as a whole. As the abstract model is infinite,
representations of the abstract data model may be finite and incomplete. Since
February 2004 the RDF specification (revised version) is defined by a “set of six”,
what stands for the set of six documents composed of Primer [11], Concepts (and
Abstract Syntax) [9], Syntax [2], Semantics [8], Vocabulary (RDF Schema) [5], and
Test Cases [7].
RDF data model is based on linguistically inspired construction composed of
a triple of the form subject – predicate – object, often called a statement or an
assertion. Universal element of RDF is a resource that is unambiguously identified by
its URI (Uniform Resouce Identifier). A resource in a statement can appear in the role
of both a subject and an object. Predicates correspond to properties of subjects, objects
refer to values of these properties. Object can have also the form of a literal, i.e
primitive data type (Fig. 1).

Fig. 1. Graph representation of a subject-predicate-object relationship

Important feature of RDF model is reification. The notion of reification originates


from latin “res”- “thing”, what means materialization, and it is used for transformation
of statement to atomic object. Reification adds to RDF model the ability to take the
entire statement as a resource and to include it in other statements. Reification can be
applied when reasoning about creditibility of individual statements on the basis of trust
of information source. Such “meta-statements” have the same quality (are on the same
level of importance) as basic statements, and we need not create special syntactic
244 Vladimír Grlický

constructions. On the other side the reification can reasonably complicate formal
features of RDF model.
Other capabilities of RDF (typed literals, support for containers, collections,
entailment etc.) are not described here but can be found in the “set of six” that is
mentioned in above paragraphs.

Fig. 2. RDF model representation using directed edge-labeled graph

Abstract data model of RDF does not specify particular representation. In case of
its graphical form a data model can be depicted as a graph; speaking more preciselly, it
is directed edge-labeled graph where subjects and objects are nodes, properties are
drawn as arcs between nodes. Fig. 2 depicts the set of free text sentences, introduced as
the example in section 1, represented by this type of graph. When we need the model to
be represented textually, we can use RDF/XML, or one of its alternative formats
briefly described in following sections.

3 RDF/XML
An RDF graph can be considered a collection of paths of the form node-predicate arc-
node which cover the entire graph. In order to encode the RDF graph in XML, the
nodes and predicates have to be represented in XML terms – element names, attribute
names, element contents and attribute values. Therefore, in RDF/XML these turn into
sequences of elements inside elements which alternate between elements for nodes and
predicate arcs. This has been called a series of node/arc stripes. The node at the start of
the sequence turns into the outermost element; the next predicate arc turns into a child
element, and so on. The stripes generally start at the top of an RDF/XML document
and always begin with nodes.
The following code presents aforementioned features of RDF/XML when
describing the RDF graph shown in Fig. 2.
An Overview of RDF Model Representation Formats 245

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">

<rdf:Description
rdf:about="http://semweb.grlicky.info/vgrlicky">
<vcard:N rdf:parseType="Resource">
<vcard:Given>Vladimir</vcard:Given>
<vcard:Family>Grlicky</vcard:Family>
</vcard:N>
<vcard:FN>Vladimir Grlicky</vcard:FN>
</rdf:Description>
</rdf:RDF>

4 Notation 3
Notation 3 [3, 4], more commonly known via its abbreviation “N3”, is a shorthand
non-XML serialization of RDF, designed with human-readability in mind. According
to the Notation 3 Specification [3], it was created as an experiment in optimizing the
“expression of data and logic in the same language”. N3 has been well received for its
“scribblability”, because it is much more compact and readable than RDF/XML, and
because it forms a good introduction into many key principles of the Semantic Web.
The code below represents RDF model, depicted in Fig. 2, encoded using N3.

@prefix : <#> .

<http://semweb.grlicky.info/vgrlicky>
<http://www.w3.org/2001/vcard-rdf/3.0#FN>
"Vladmir Grlicky" ;
<http://www.w3.org/2001/vcard-rdf/3.0#N>
[ <http://www.w3.org/2001/vcard-rdf/3.0#Family>
"Grlicky" ;
<http://www.w3.org/2001/vcard-rdf/3.0#Given>
"Vladimir" ] .

As its current disadvantages we can mention the long term stability of N3, which
is not known, there are some internationalization issues, and a notable lack of analogies
for various features of N3 in RDF/XML.

5 N-Triples
As stated in [1], N-Triples is a line-based, plain text format for representing the correct
answers-statements for RDF. This format was designed to be a fixed subset of N3
(briefly described in section 4), hence all tools, which currently work with N3, can
seamlessly work with it, too. Each triple must be written on a separate line, and
consists of a subject specifier, a predicate specifier, then an object specifier, followed
246 Vladimír Grlický

by a period. One or more spaces or tabs separate subject from predicate, and predicate
from object.

_:BN01
<http://www.w3.org/2001/vcard-rdf/3.0#Given>
"Vladimir" .
<http://semweb.grlicky.info/vgrlicky>
<http://www.w3.org/2001/vcard-rdf/3.0#N>
_:BN01 .
_:BN01
<http://www.w3.org/2001/vcard-rdf/3.0#Family>
"Grlicky" .
<http://semweb.grlicky.info/vgrlicky>
<http://www.w3.org/2001/vcard-rdf/3.0#FN>
"Vladimir Grlicky" .

The source code above represents exemplary RDF graph model (Fig. 2) using N-
Triples format. Because of its plain text line-oriented nature N-Triples is simple and
very easy machine-processable RDF representation format.

6 TriX
TriX (Triples in XML) [6] is a serialization for named graphs. Its creators tried to
provide a highly normalized and consistent XML representation of RDF model (i.e.
graphs), which allows the effective use of generic XML tools as XSLT, XQuery and
others. The RDF model (Fig. 2) represented in TriX is shown below:

<trix xmlns="http://www.w3.org/2004/03/trix/trix-1/">
<graph>
<uri>http://semweb.grlicky.info/graph1</uri>
<triple>
<id>BN01</id>
<uri>http://www.w3.org/2001/vcard-rdf/3.0#Given</uri>
<plainLiteral>Vladimir</plainLiteral>
</triple>
<triple>
<uri>http://semweb.grlicky.info/vgrlicky</uri>
<uri>http://www.w3.org/2001/vcard-rdf/3.0#N</uri>
<id>BN01</id>
</triple>
<triple>
<id>BN01</id>
<uri>http://www.w3.org/2001/vcard-rdf/3.0#Family</uri>
<plainLiteral>Grlicky</plainLiteral>
</triple>
<triple>
An Overview of RDF Model Representation Formats 247

<uri>http://semweb.grlicky.info/vgrlicky</uri>
<uri>http://www.w3.org/2001/vcard-rdf/3.0#FN</uri>
<uri>Vladimir Grlicky</uri>
</triple>
</graph>
</trix>

One of the main advantages in Trix over RDF/XML is the ability to name graphs,
syntactic extensibility, direct processing with XML tools (XSLT, XQuery, XPath)
while still satisfying the well-formedness and validity of XML documents.

7 Conclusions
In this paper we tried to show that a set of sentences, modeled using RDF, can be
represented not only by RDF/XML but also by other RDF representation formats. We
briefly described some of alternatives to RDF/XML (N3, N-Triples, and TriX). These
formats can encode RDF model without any loss of information, when compared with
RDF/XML. However, it is important to say that this overview provided no formal
proof of assertions stated here. When choosing “the right” RDF representation format,
one should pay attention especially to its application support and capabilities to share
and exchange ontologies modeled by RDF and represented by this format.

Acknowledgement: This work was supported by Science and Technology Assistance


Agency under the contract No. APVT-20-007104.

References
1. Beckett, D.: N-Triples. W3C RDF Core WG Internal Working Draft. Cambridge,
MA, USA: W3C, 2001. http://www.w3.org/2001/sw/RDFCore/ntriples/
2. Beckett, D., McBride, B. (eds.): RDF/XML Syntax Specification (Revised). W3C
Recommendation 10 February 2004, Cambridge, MA, USA: W3C, 2004.
http://www.w3.org/TR/rdf-syntax-grammar/
3. Berners-Lee, T.: Notation 3: An RDF language for the Semantic Web. Cambridge,
MA, USA: W3C, 2001. http://www.w3.org/DesignIssues/Notation3.
4. Berners-Lee, T.: Primer: Getting into RDF & Semantic Web using N3. Cambridge,
MA, USA: W3C, 2004. http://www.w3.org/2000/10/swap/Primer.html
5. Brickley, D., Guha, R., McBride, B. (eds.): RDF Vocabulary Description
Language 1.0. RDF Schema. W3C Recommendation 10 February 2004.
Cambridge, MA, USA: W3C, 2004. http://www.w3.org/TR/rdf-schema/
6. Carroll, J., Stickler, P.: RDF Triples in XML. Bristol: Digital Media Systems
Laboratory, HP Laboratories, Technical Report HPL-2003-268, 2004.
http://www.hpl.hp.com/techreports/2004/
HPL-2004-56.pdf
248 Vladimír Grlický

7. Grant, J., Beckett, D., McBride, B. (eds.): RDF Test Cases. W3C Recommendation
10 February 2004. Cambridge, MA, USA: W3C, 2004. http://www.w3.org/TR/rdf-
testcases/
8. Hayes, P., McBride, B. (eds.): RDF Semantics. W3C Recommendation 10
February 2004. Cambridge, MA, USA: W3C. 2004. http://www.w3.org/TR/rdf-
mt/
9. Klyne, G., Carroll, J., McBride, B. (eds.): Resource Description Framework
(RDF): Concepts and Abstract Syntax. W3C Recommendation 10 February 2004.
Cambridge, MA, USA : W3C, 2004. http://www.w3.org/TR/rdf-concepts/
10. Lassila, O., Swick, R.: Resource Description Framework (RDF) Model and Syntax
Specification. W3C Recommendation 22 February 1999. Cambridge, MA, USA:
W3C, 1999. http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/
11. Manola, F., Miller, E., McBride, B. (eds.): RDF Primer. W3C Recommendation 10
February 2004, Cambridge, MA, USA: W3C, 2004. http://www.w3.org/TR/rdf-
primer/
Sharing a User Model between Several
Adaptive Hypermedia Applications
Jaroslav KURUC∗
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
kuruc@fiit.stuba.sk

Abstract. In this paper we present an approach to sharing a user


model between several adaptive hypermedia (AH) applications. In
current AH applications, user model is often realized as the internal
part of the system, without any possibility to share this model between
other AH applications. Our approach introduce the web service acting
as a central store of user characteristics represented in pre-defined
ontologies defining semantics of the stored knowledge. Access and
corresponding privileges to the web service is managed by user
through the management interface. User is also able to inspect/modify
the state of the user model.

1 Introduction
The aim of the adaptive hypermedia (AH) application is to reflect some features of the
user in a user model and use this model by adapting various visible aspects of the
system to the user. As described in reference models of adaptive hypermedia [1, 2], the
user model together with the domain model and the adaptation model are three basic
parts of every AH application. The role of the user model is to represent several users'
characteristics such as user's knowledge, preferences, interests, tasks or goals. It is also
considered as the source of the adaptation used in the adaptation model when adapting
information from the domain model.
The user model is often managed by the AH application itself, realized as the
internal part of the system, without any possibility to share this model between other
AH applications. This approach has several disabilities.


Supervisor: doc. Ing. Mária Bieliková, PhD., Institute of Informatics and Software
Engineering, Faculty of Informatics and Information Technologies STU in Bratislava

M. Bieliková (Ed.), IIT.SRC 2005, April 27, 2005, pp. 249-256.


250 Jaroslav Kuruc

One of the main problems when working with the user model is the initialization
of this model. To achieve effective personalization, AH application needs to know the
characteristics of the user as much as possible. When the user is using the system for
the first time, default values in the user model are used. As the user works with the
system more and more, the user model is more accurate and personalization more
effective. The problem is when the user uses more that one AH application and theses
applications do not cooperate in the task of modeling user characteristics. Initialization
phase is needed for every AH application, even they could use at least domain
independent characteristics which do not (or not often) change such as presentation
preferences, desired language, etc. Even better solution would be to collect the
knowledge about the user in a central knowledge base and use this knowledge by
different AH applications as appropriate. AH applications working on the same (or
similar) domain would cooperate on the same part of the user model.
Next problem is that the user doesn't have the control or the information what is
stored in the user model. AH application collects the information about the user
regarding the interaction with system and uses this information later for the adaptive
purposes. Collected information is often hidden to the user, what may cause in fear of
misuse of this information. The skepticism may lead to refusing to use such systems. A
solution to the problem of privacy would be to a transparent presentation of the
contents of the user model with a possibility to change it. Only few existing AH
applications support mechanism for inspecting/changing the state of user model by the
user itself, usually through a form based wizards. Therefore, a uniform way of
inspecting/changing the user model independent on the features of the AH application
is needed.
Regarding to the mentioned problems, an effort to separate the user model from
the AH applications itself is the meaningful way towards the cross-application
adaptation.
The paper is structured as follows. In section 2 we characterize the representation
of the user model in current AH applications, together with the mechanism for
updating this model and its utilization for the adaptation purposes. Next, in section 3,
we describe the architecture for sharing a user model between several AH applications
we proposed. Finally, we give conclusions and proposals for further work.

2 User Model in Current AH Applications


The source of the adaptation in AH application is the user characteristics significant
from the adaptation point of view. It could be the user's knowledge of the domain AH
application is working on, user's preferences, interests, goals etc. Generally, these
characteristics are expressed by the user model.
From the modeling point of view, characteristics are usually represented as
attribute-value pairs. There are domain dependent attributes and domain independent
attributes. Domain dependent attributes extend definition of concepts in the domain
model to store user specific values for these concepts. Well-known example in the
education area is an attribute representing the knowledge of a particular concept by the
Sharing a User Model between Several Adaptive Hypermedia Applications 251

user. Attributes independent on the domain represent characteristics useful without any
consideration to the specific domain, e.g. desired language, preferred media, color
scheme used in the presentation, etc.
User model is considered also as an extension of the domain model, where it
extends the definition of the concepts with the definition of the domain dependent
attributes. One example of such system is the system AHA! [3]. The definition of the
user model lies in defining unique attributes for concepts. Values of the attributes can
be booleans, integer numbers or strings. For every user, an instance of the user model
is maintained and used for adaptation purposes.
From the maintenance point of view, following aspects should be covered when
working with the user model:
• initialization of the user model,
• user observation,
• processing of the observed information in form of updating user model,
• usage of the user model for the purposes of the adaptation.
Initialization of the user model might be realized by different techniques. The
definition of the attribute in system AHA! contains except the attribute identifier and
value type also default value. Thus, the presentation is same for all users who are
working with the system for the first time. Another solution is to classify users in
several user groups and assign default values for these groups. Some educational AH
applications require user to go through initial test to observe the user knowledge and
initialize her user model appropriately.
User observation consists of monitoring the user activity during the usage of the
AH application. System monitors the links user is following, items she is selecting
from the menu, time spent on particular pages, etc. Some AH applications prompt user
to enter some kind of information. Educational AH applications sometimes provide the
user with the possibility to enter whether she understands presented information.
The way observed information about the user is reflected in the user model, same
as the way the state of the user model influence the adaptation, is defined in the
adaptation model. Usually, it is realized by the rules. In system AHA!, the definition of
concept contains the rules evaluated when the page containing information fragments
corresponding with the particular concept is showed. The rules determine which
attribute values are changed, where new value is often a result of an expression.
<concept>
<name>de_koninck</name>
<desc>De Koninck Beer</desc>
<resource>de_koninck.xhtml</resource>
<req>beer.interest > 50</req>

<attribute name="access" type="bool" isSystem="true"


isPersistent="false" isChangeable="false">
<default>false</default>
252 Jaroslav Kuruc

<generateListItem isPropagating="true">
<req>beer.interest < 100</req>
<trueActions>
<action>
<concept>beer</concept>
<attribute>interest</attribute>
<expr>beer.interest + 10</expr>
</action>
...
</trueActions>
<falseActions>
...
</falseActions>
</generateListItem>
...
</attribute>
...
</concept>
In the previous code (adopted from [4], detailed explanation can be also found
in [5]) a sample fragment of domain/user model definition in system AHA! is shown.
Given code shows the definition of concept de_koninck representing information
fragment about the Belgian beer brand. The content of the information fragment is
defined in the page de_koninck.xhtml. The concept is considered to be suitable
when the expression beer.interest > 50 is fulfilled (which means that user is
interested in beers). Thus, the current value stored in the user model for the attribute
interest defined in the concept beer is considered. Since the value differs for
particular users, concept may be more or less suitable. This is the example of usage of
the user model for the purposes of adaptation.
The definition of concept includes also the definition of attribute access which
has associated rules (a set of generateListItem definitions) for updating user
model. When the page de_koninck.xhtml is shown, the value of attribute access
becomes temporarily true and the associated rules are evaluated. Every rule has defined
condition. When the condition is fulfilled, a set of actions (trueActions) is applied.
Otherwise, other set of actions (falseActions) is applied. In our case, when the
condition beer.interest < 100 is fulfilled, one action to be applied is showed.
This action changes the value of attribute interest inside the concept beer by
increasing its value by 10. Since the rule has specified isPropagating attribute as
true, by changing the value of attribute interest inside the concept beer, also the
rules associated with this attribute are evaluated. Showed mechanism observes the
pages user is selecting and updates the user model appropriately.
Presented approach of definition of user model in current AH applications assume
the implicit semantics of attributes and its values. Only the designer knows what
particular attribute stands for and what is the interpretation of its value. To use the user
model by more AH applications, an explicit definition of the user model semantics and
a separation of domain model and the user model is required.
Sharing a User Model between Several Adaptive Hypermedia Applications 253

3 Shared User Model


In the previous section, we characterized common used approach for modeling user
characteristics in the under model. To support sharing of user model between several
AH applications we proposed an approach based on the following principles:
• the user model management is independent on the implementation of AH
applications which are using it,
• the semantics of the information stored in the user model is explicitly defined,
• user is able to observe/change information stored in the user model.
To achieve the independence on the implementation of AH applications, we
proposed to use web services technology. The purpose of the User Model Web
Service (WS) is to store the user model and provide functionality to cooperating AH
applications for obtaining information stored in the user model and for updating it.
To ensure explicit semantics definition of the information stored in the user
model, we proposed to use ontology based representation. Since AH applications may
differ in the domain they are operating over, there is a need to distinguish between the
representation of the domain dependent part of the user model and the part which is
common for all domains. Domain dependent attributes usually express user
characteristics which affect the content or navigation adaptation (what information is
presented and how can it be accessed), whereas domain independent attributes usually
affect the presentation adaptation (how is the information presented).
The aspects affecting the presentation adaptation can be the device user is using
for accessing the information, the language user prefers, suitable media, etc. All these
characteristics may affect the presentation no matter what domain is on side and all AH
applications may use/share them. For these characteristics a common ontologies may
be defined. One example of such ontology is Composite Capability/Preference
Profiles (CC/PP) [6], a W3C recommendation which can be used for expressing device
capabilities and/or user preferences. Another example is an ontology for describing
general user characteristics like contact information, emotional state, mental state,
personality, etc. [7].
More difficult situation is when representing domain dependent user
characteristics. Two different AH applications operating over same (or similar) domain
may use different levels of abstraction or other points of view. Thus, the same
knowledge may be represented by different ways. The solution would be to support the
representations in different ontologies and if possible to provide the mapping between
these ontologies by the User Model WS. Not cooperating AH applications would use
the web service to store user characteristics in their own ontology and using only this
ontology. More intelligent AH applications would cooperate and use also arranged
ontologies.
Our approach uses the semantic web technologies for ontology representation like
RDF(S) or other higher level ontology languages like OWL. The existence of tools and
query languages like RDQL gives us also a possibility to discover new knowledge
from the stored characteristics, what may extend the possibilities of the adaptation.
254 Jaroslav Kuruc

To ensure a possibility for user to observe/change the state of the user model, web
service should provide appropriate interface for browsing the ontologies used for
representing user model and for changing the instances of these ontologies. Our
approach includes the Management interface used also for these purposes.
Proposed architecture is shown in Fig. 1. Particular AH applications communicate
with the User Model WS by SOAP (Simple Object Access Protocol) protocol over
http (Hypertext Transfer Protocol) protocol using SSL (Secure Socket Layer). Every
AH application has its own domain/adaptation model and uses User Model WS to
manage the user model. User accesses AH applications (by HTTP protocol using SSL)
via web interfaces they provide using assigned user accounts. Since AH applications
need to know how to access web service, they provide an interface for configuring
address of the web service server and credentials used for authentication/authorization
when accessing web service.

DB

JDBC

User Model WS API Management


RDF/OWL Interface

SOAP/SSL SOAP/SSL HTTP/SSL

AH System 1
... HTTP/SSL

AH System N User

Fig. 1. Architecture for sharing a user model between several AH applications.

User creates an account for the AH system in the User Model WS through the
Management Interface, realized as a web interface using User Model WS internal API.
Management interface allows user to define the access for cooperating AH
applications, same as the privileges they have when accessing web service. In case of
RDF model, privileges definition includes the namespace in RDF model and particular
access rights (a set of rules, where rule determines wheather accessing application is
authorized/denied to read/write from/to specified namespace).
Since some of the information stored in the user model has permanent character, a
serialization mechanism is needed. Our approach uses relational database accessed via
JDBC for storage permanent data.
Sharing a User Model between Several Adaptive Hypermedia Applications 255

4 Related Works
Similar architecture for sharing a user model is a Personis server [256]. It is also based
on the web services technology, and provides cooperating adaptive applications with
the functionality for retrieving stored data and for updating it. Stored data is based on
component-evidence-source triplets, where component represents the attribute of the
user model, evidence its value and source is the origin adaptive application which
stored the information. The main focus is on the user control and scrutability of the
user model. The main difference between this approach and approach we proposed is
in the representation of the stored data. In the personis server, no explicit definition of
the semantics is considered, what limits the usage of stored information by other
adaptive application and overall cross-application adaptivity.

5 Conclusions
In this paper, we have described architecture for sharing user a model between several
adaptive hypermedia applications we approached. Our approval is based on using
separating user model from the domain model and explicit definition of the semantics
of information stored in the user model.
The main contribution of this approach is a possibility to share the knowledge
about the user collected by one AH application and use it by other AH applications.
This feature can help AH applications to solve the problem with initialization of the
user model. Besides that, central storage gives user an opportunity to explore the stored
information and to change it. Furthermore, user characteristics stored in user model are
represented using ontologies, what gives us a possibility to discover new knowledge.
In the future, we plan to implement the prototype of the proposed architecture.
We want to create the following subsystems:
• User Model Web Service managing user model storage, providing interface
for AH applications to obtain the stored information and to update it,
• sample AH application using User Model WS for managing user model and
• Management Interface allowing user to define access rights for cooperating
AH applications and an interface for observing/updating user model.

Acknowledgement: This work was supported by Science and Technology Assistance


Agency under the contract No. APVT-20-007104.

References
1. De Bra, P. Houben, G.-J., Wu, H.: AHAM: A Dexter-based reference model for
adaptive hypermedia. In: Proc. of the tenth ACM Conference on Hypertext and
hypermedia: Returning to our diverse roots, Darmstadt, Germany (1999), 147-156.
2. Koch, N., Wirsing, M.: The Munich reference model for adaptive hypermedia
applications. In: Proc. of Internation Conference on Adaptive Hypermedia and
256 Jaroslav Kuruc

Adaptive Web-Based Systems, P. De Bra, P. Brusilovsky, and R. Conejo (Eds.),


Springer Verlag, LNCS 2347, Málaga, Spain (2002), 213-222.
3. De Bra, P., Aerts, A., Berden, B., de Lange, B., Rousseau, B., Santic, T., Smits, D.,
Stash, N.: AHA! The adaptive hypermedia architecture. In: Proc. of the ACM
Hypertext Conference, Nottingham, UK (2003), 81-84.
4. De Bra, P., Aerts, A., Smits, D., Stash, N.: AHA! Version 2.0, More adaptation
flexibility for authors. In: Proc. of the AACE ELearn'2002 Conference, 2002,
240-246.
5. Bieliková, M., Kuruc, J.: Content creation in the educational adaptive hypermedia.
In: Proc. of Technologie pro e-vzdělávání, B. Mannová, P. Šaloun, and M.
Bieliková (Eds.), Praha, Czech Republic (2004), 11-21 (in Slovak).
6. Klyne, G., Reynolds, F., Woodrow, Ch., Ohto, H., Hjelm, J., Butler, M.H., Tran,
L.: Composite Capability/Preference Profiles (CC/PP): Structure and Vocabularies.
W3C, 2001. Available at http://www.w3c.org/TR/CCPP-struct-vocab (7.4.2005)
7. Heckmann, D., Schwartz, T., Brandherm, B., Schmitz, M., von Wilamowitz-
Moellendorff, M.: GUMO - The general user model ontology. In: Proc. of UM
2005: Int. Conf. on User Modeling, Edinburgh, UK (2005), (to appear).
8. Kay, J., Kummerfeld, B., Lauder, P.: Personis: A server for user models. In: Proc.
of Adaptive Hypermedia and Adaptive Web-based Systems, P. De Bra, P.
Brusilovsky, and R. Conejo (Eds.), Springer Verlag, LNCS 2347, Málaga, Spain
(2002), 203-212.
Accompanying
Events
RoboCup exhibition at IIT-SRC 2005
Pavol NÁVRAT, Ivan KAPUSTÍK
Slovak University of Technology
Faculty of Informatics and Information Technologies
Ilkovičova 3, 842 16 Bratislava, Slovakia
navrat@fiit.stuba.sk

Abstract. RoboCup is an attractive project theme with a free


participation, designed to support education and research in artificial
intelligence, robotics and information technologies. During last few
years, our students achieved some interesting results, which will be
presented during this conference.

1 Motivation
RoboCup is an international joint project to promote artificial intelligence, robotics and
information technologies. It is an attempt to advance AI and intelligent robotics study
and research by providing an ordinary problem where wide range of technologies can
be integrated and examined. RoboCup chose to use soccer game as a central topic of
research, with the ultimate goal of the RoboCup project – by 2050, develop a team of
fully autonomous humanoid robots that can win against the human world champion
team in soccer.
In order for a robot team to actually perform a soccer game, various technologies
must be incorporated, including design principles of autonomous agents, multi-agent
collaboration, strategy acquisition, real-time reasoning, robotics, and sensor-fusion.
RoboCup is a task for a team of multiple fast-moving and skilled robots under a
dynamic environment. It also offers a software platform for research on the software
aspects. RoboCup is divided into three main fields: RoboCup Soccer – directed to the
original soccer area, RoboCup Rescue – intended to do search and rescue in large scale
disaster and RoboCup Junior – aimed to children education and motivation.
From our point of view, the main goal of RoboCup is to promote research in areas
of artificial intelligence and information technologies, especially in the area of multi-
agent systems. This is a benefit for the students, making their studies more interesting
and attractive. Students can meet with robotic soccer in courses like Artificial
Intelligence, Team Project and others. Students are facing an interesting problem,
which demands invention as well as use of modern artificial intelligence approaches.
Teams of students have the possibility to directly compare their results in tournaments.

IIT-SRC 2005, Bratislava, 27. 4. 2005, pp. 261-262.


262 Pavol Návrat, Ivan Kapustík

This encourages the students to even higher effort and motivates them for better
results. More fundamentally, achieving progress requires tackling serious open
research problems in artificial intelligence, such as planning of cooperation of multiple
agents etc. That is why this area is of interest also for our doctorate students.
We have been organizing this tournament regularly for several years. Starting as a
local event in 2000, it has grown to a regional contest under the official RoboCup
authorization. Our Faculty organizes tournaments in the simulated category only,
however we are planning to include other categories, too. Every our contest has two
parts. First part is a tournament, where students try to make their players win. Second
part is an exhibition of participating teams, including the most impressive parts of the
matches and presentations of the players, innovative ideas and methods the teams used.

2 Results presentation
For this student conference we decided to hold such an exhibition and present both the
way RoboCup simulated league is played and also the progress of current students
research in this field.
Students’ main research is aimed to team tactics. It covers team formations and
planning, player communication and use of a team coach. Each of these topics has also
its specific themes. Formation can be static and dynamic and contain subformations for
particular situations. Formation and team play can be also changed by plans, developed
by any player through the game. Plans are distributed by permitted communication.
But communication also allows players to react on immediate situation and direct team
play. Similarly, the role of a coach is irreplaceable in modern soccer. Artificial coach
can assess the game situation in progress and send appropriate tactical information to
players or even alternate players.
We hope that this exhibition will attract many present and future students and
give them motivation for their study and research work.
More information about our contests, can be found on the web page
http://www.fiit.stuba.sk/robocup/2005/eng/turnaj_menu.htm
Author Index
Adam, Martin, 195 Lekavý, Marián, 49
Andrejko, Anton, 235 Líška, Miroslav, 167
Angelovič, Peter, 27 Mesjar, Peter, 77
Backo, Tomáš, 90 Mikita, Ondrej, 213, 219
Bagala, Adrian, 96 Mostafa, Hossam el-ddin, 103
Barla, Michal, 195 Navarčik, Matúš, 175
Bartalos, Peter, 69 Návrat, Pavol, 261
Bott, Roland, 96 Ölvecký, Tomáš, 1
Buno, Juraj, 90 Pullman, Peter, 90
Burák, Jozef, 90 Semančík, Radovan, 116
Dysko, Igor, 128 Sivák, Peter, 195
Frivolt, György, 35 Slavkovský, Adrián, 134
Gregor, Marek, 213, 219 Sýkora, Miloš, 146
Grlický, Vladimír, 242 Sýkora, Peter, 14
Hluchý, Pavol, 201 Šarmír, Ján, 207
Jakubík, Jaroslav, 151 Šípka, Miloslav, 140
Jakubík, Michal, 224 Tomša, Marek, 8
Jarábek, Branislav, 108 Trebatický, Peter, 57
Kapustík, Ivan, 261 Tvarožek, Michal, 195
Katana, Daniel, 90 Veselý, Richard, 8
Koprla, Marek, 90 Vozár, Oto, 8
Košík, Matej, 159 Zajac, Jaroslav, 22
Krištofič, Andrej, 229 Zálešák, Vladislav, 21
Kubík, Michal, 84 Zaťko, Tomáš, 83
Kuruc, Jaroslav, 249 Žiak, Ján, 183
Lacko, Peter, 41

263
Mária Bieliková (Ed.)

IIT.SRC 2005: Student Research Conference in


Informatics and Information Technologies

1st Edition, Published by


Slovak University of Technology in Bratislava

263 pages
Print Vydavateľstvo STU Bratislava
2005

You might also like