Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • T TaRDIS-DCR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Departamento de Informática
  • Research
  • TaRDISTaRDIS
  • WP3
  • TaRDIS-DCR
  • Wiki
  • Dcr choreographies
  • EDP Use Case

EDP Use Case · Changes

Page history
Update EDP Use Case authored Oct 15, 2024 by Diogo Ye's avatar Diogo Ye
Hide whitespace changes
Inline Side-by-side
DCR-Choreographies/EDP-Use-Case.md
View page @ 9002557c
# Overview
An Energy Community is a network of local consumers and producers that efficiently share energy resources. In these communities, "prosumers" both produce and consume energy. For instance, homes equipped with solar panels generate energy, while electric vehicles or batteries act as consumers. Using automated systems, prosumers can send energy requests and make offers, optimizing local energy exchange in a decentralized manner. Below, we present an extension of the ReGraDa language to model this use case:
An Energy Community is a network of local consumers and producers that efficiently share energy resources. In these communities, "prosumers" both produce and consume energy. For instance, homes equipped with solar panels generate energy, while electric vehicles or batteries act as consumers. Using automated systems, prosumers can send energy requests and make offers, optimizing local energy exchange in a decentralized manner.
Below, we present an extension of the ReGraDa language to model this use case:
```ruby
# roles
......@@ -28,6 +31,57 @@ P flows P
(reject_2: reject) (Z;Z) [?] [P(0) -> P(2)]
;
consume -->* reply_1
consume -->* reply_2
reply_1 -->* reject_1
reply_2 -->* reject_2
reply_1 -->* accept_1
reply_2 -->* accept_2
reply_1 -->% reply_1
reply_2 -->% reply_2
accept_1 -->% reject_1
reject_1 -->% accept_1
accept_2 -->% reject_2
reject_2 -->% accept_2
accept_1 -->% accept_1
accept_2 -->% accept_2
reject_1 -->% reject_1
reject_2 -->% reject_2
```
There is only one role, Prosumer represented as P, and to identify each prosumer, we parameterize the role with an id, _e.g:_ `P(1)`.
> **NOTE**: The roles are defined in the first lines of the process and are used to identify the prosumers in the process. The role `Z` is a dummy role that is used to define the security lattice and information flow of all the events in the process.
---
The process is composed of the following events which represent the information of each prosumer (computation events).
```ruby
(pInfo_1:Info) (Z;Z) ['Electric Vehicle'] [P(0)]
(pInfo_2:Info) (Z;Z) ['House with Solar Panel'] [P(1)]
(pInfo_3:Info) (Z;Z) ['House with Battery'] [P(2)]
```
To emulate the intended behavior, we execute the `consume` event of `P(0)` which will request energy from `P(1)` and `P(2)`. To respond to the request, we use the events `reply_1` and `reply_2`, sending a message between `P(1)`and`P(2)`to`P(0)`(interaction events).
```ruby
(reply_1: replyConsume) (Z;Z) [?: {kw:Number, t:String}] [P(1) -> P(0)]
(reply_2: replyConsume) (Z;Z) [?: {kw:Number, t:String}] [P(2) -> P(0)]
(accept_1: accept) (Z;Z) [?] [P(0) -> P(1)]
(reject_1: reject) (Z;Z) [?] [P(0) -> P(1)]
(accept_2: accept) (Z;Z) [?] [P(0) -> P(2)]
(reject_2: reject) (Z;Z) [?] [P(0) -> P(2)]
```
To define the process flow, we use arrows representing relations between events ([doc](DCR%20Choreographies)). These arrows indicate the requirement for either acceptance or rejection of each request.
```ruby
# producers can't reply until they receive a request
consume -->* reply_1
consume -->* reply_2
......
Clone repository
  • DCR Choreographies
    • EDP Use Case
    • Simple EDP Use Case
  • Prototype
  • Home