Modeling Behavior of Self
Download
Report
Transcript Modeling Behavior of Self
Modeling Behavior of Self-Adaptive
Systems
Seminar Software Quality and Safety
Christian Heinzemann
17. Juli 2015
Railcab shuttles are autonomous train systems
Transport goods or people
May form convoys to save energy
Here: Two modes of operation
Energy efficient travelling
Fast travelling to fulfill a pressing deadline
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 2
http://nbp-www.upb.de/typo3temp/pics/b6345617cd.png
Example scenario
Motivation
Autonomous systems operate without human control
Intuitively: Self-Adaptive systems adapt own behavior
autonomously
Useful in situations that are
dangerous, e.g. chemical accidents
unpleasantly, e.g. dusty environments
stupid, e.g. manufacturing at assembly-lines
Systems should react to environment changes
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 3
Self-Adaptive Software
Definition:
„Self-Adaptive Software evaluates its own behavior and
changes behavior when the environment indicates that it is
not accomplishing what the software is intended to do, or
when better functionality or performance is possible.”
DARPA Broad Agency Anouncement
Here:
Shuttle must increase speed when deadline might be
missed
Shuttle may decrease speed when deadline can be
accomplished easily
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 4
General approach
Self-Adaptation requires
Monitoring of environment
Analysis of monitored state
Knowledge about own architecture and behaviors
Ability to modify architecture and/or load algorithms
Observers
Architecture
editor
Observation
analysers
Adaptation
planning and
deployment
cf. Oreizy et.al. - An Architecture-Based Approach to Self-Adaptive Software
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 5
General steps in modeling selfadaptive behavior
General modeling approach introduced by Zhang
and Cheng:
1. Specify global invariants
2. Enumerate domains and conditions under which system is
in domain
3. Specify local properties for each domain
4. Build state based models for each domain
5. Enumerate possible domain changes and build adaptation
models
6. Use state-based models to generate test cases.
cf. Ji Zhang, Betty H.C. Cheng - Model-Based Development of Dynamically Adaptive Software
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 6
1. Specify global invariants
Two properties for shuttle scenario
(1) Shuttle will eventually reach its target
(2) If a deadline exists, the shuttle will fulfill it
Properties are specified using temporal logic
(1) G F shuttle_atTarget
(2) G (existsDeadline => (t(shuttle_atTarget) <= deadline)
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 7
2. Enumerate domain and conditions
Two modes of operation correspond to two domains
Energy efficient travelling
•
•
In case of no deadline
In case of non pressing deadline
Fast travelling
•
In case of pressing deadline
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 8
3. Specify local properties
Local properties must fulfill global properties
Properties for energy efficient travelling
G( convoy_available => join_convoy)
Properties for fast travelling
G( convoy_available speed(convoy) < speed(this)
=> overtake_convoy)
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 9
4. Build state-based models
Models are steady-state models that contain no
adaptive behavior
Can be Model Checked against local properties
Energy efficient travelling
Christian Heinzemann
Fast travelling
Modeling Behavior of Self-Adaptive Systems - 10
5. Enumerate domain changes …
Domain changes:
Energy efficient travelling -> Fast travelling
•
Fast travelling -> Energy efficient travelling
•
Change if deadline cannot be fulfilled with current speed
Change if deadline can be reached with efficient speed
Adaptation model describes switch from old to new
behavior
Adaptations can be model checked against global
properties
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 11
… and build adaptation models
Adaptation possible in so called quiescent states
Intuitively: Quiescent states are stateless and
therefore equivalent to the initial state
E.g. switch from energy efficient to fast travelling
adaptReq(1)
Performs the
change,
transfers
important
variables.
Adaptation
Model 1
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 12
6. Generate test-cases
Use state-based models to generate test-cases
Can be done using standard techniques
Shall not be treated here.
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 13
Structure and behavior
adaptation
Seen so far:
pure structure adaptation
pure behavior adaptation
But: Structure and behavior influence each other!
Changing system structure changes system behavior
Changing behavior may require new components and links
Behavior change may be implemented by loading
components
New components may introduce new behavior
It might not be known how many components are
connected at runtime
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 14
Structure change affects behavior
Example:
Shuttles can build convoys
Build of a new convoy requires one shuttle to coordinate
Needs additional coordination behavior
Change can be executed by loading a new component
which provides coordination behavior
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 15
Comparison
Commonalities:
Allow adaptation only on one hierarchy level
Selection of next algorithm out of fixed set
Differences
States from which adaptation is possible
• Approach by Zhang & Cheng allows to jump directly into new
behavior
• Mechatronic UML starts component behavior from the initial state
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 16
Limitations
Self-Adaptive systems and modeling of these system
is still under research
Some points are still unclear:
How can surprise be handled by the system?
Will the system behave reasonable and find a good solution
in all environment situations?
How can self-adaptation be combined with learning
algorithms to optimize adaptation decisions at runtime?
cf. Laddaga - Self Adaptive Software – Problems and Projects
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 17
Conclusions
Self-Adaptive systems operate autonomously and
adapt to changing environment
Self-Adaptation requires monitoring of the
environment and knowledge about own architecture
General approach proposes six steps during the
modelling process.
Adaptations can be modelled by adaptation models
Structure and behavior influence each other
Self-Adaptation is still under research
Christian Heinzemann
Modeling Behavior of Self-Adaptive Systems - 18
Degrees of Self-Adaptation
Low
Conditional expressions
Online algorithms
Parameterized algorithms
Algorithm selection
High
Christian Heinzemann
Evolutionary Programming
Modeling Behavior of Self-Adaptive Systems - 19