Context-Oriented Programming and Modeling in Julia with Context Petri Nets

Research output: Contribution to book/Conference proceedings/Anthology/ReportConference contributionContributedpeer-review

Abstract

In the future, technical systems, e.g., cyber-physical systems will increasingly become adaptive to changing contexts. However, programming context-adaptive systems is challenging. The context-specific behavior as well as when contexts change their activeness must be specified. Common general-purpose object-oriented languages require encoding the context-specific behavior in if-cascades. Standard polymorphism is insufficient to express the changing behavior of objects in different contexts because the complexity rises with the combinatorial explosion of a large, potentially multi-dimensional context space. Moreover, specifying when contexts are active has to be implemented as part of the application logic. In conclusion, there are two problems: the definition of context-specific behavior and the management of context changes. In this paper, we present a framework for the Julia programming language to develop context-adaptive systems. The framework also enables context-adaptive equation-based modeling. For context management, Petri nets are utilized. Julia was chosen for the implementation due to its simulation ecosystem, rich metaprogramming, and multiple dispatch, which enables precise specification of behavioral variants. We evaluate our approach by using two examples. The first scenario is a smart home control application. The second example shows how our framework can be used together with equation-based modeling for simulation.

Details

Original languageEnglish
Title of host publicationProceedings - 2024 50th Euromicro Conference on Software Engineering and Advanced Applications, SEAA 2024
PublisherIEEE
Pages1-9
Number of pages9
ISBN (electronic)979-8-3503-8026-2
Publication statusPublished - 2024
Peer-reviewedYes

External IDs

ORCID /0000-0003-1537-7815/work/175749239
ORCID /0000-0002-3513-6448/work/175749618
ORCID /0009-0008-3887-3217/work/175771115
Scopus 85218630783

Keywords

Keywords

  • Julia, Context-Aware Systems, Self-Adaptive Systems, Simulation, Petri nets, Cyber-Physical Systems, Contexts