Skip to content

Extend activities#36

Merged
gomezzz merged 22 commits intomainfrom
extend_activities
Nov 23, 2022
Merged

Extend activities#36
gomezzz merged 22 commits intomainfrom
extend_activities

Conversation

@gomezzz
Copy link
Collaborator

@gomezzz gomezzz commented Oct 28, 2022

Description

Summary of changes

  • Reworked activities, you can now perform activities in real time and they will be run and drain power etc.
  • Allowed a constraint function to be specified which determines interruption of activity
  • Allowed a termination function which gets executed if the activity ends (also if interrupted)
  • Added ActivityManager, ActivityProcessor and ActivityRunner for the above purposes.
  • ActivityManager tracks registered activities
  • ActivityProcessor performs paseos updates in the background and checks constraints
  • ActivityRunner executes the activtiy and its termination function and provides access to the constraint function
  • Added a test which can also be instructional on how the new activities work here: https://github.com/aidotse/PASEOS/blob/extend_activities/paseos/tests/activity_test.py
  • Added ability to check if an actor is in eclipse
  • Automatically update battery and charge it based on time passed
  • Added a second timestep in cfg that defines the background monitor's update interval

Resolved Issues

How Has This Been Tested?

  • New test
  • Design it test-driven

Related Pull Requests

N/A

@gomezzz gomezzz added tests Anything related to the tests feature implementing a new feature user-facing Anything that users can interact with physical-model All things involving some physical models labels Oct 28, 2022
@GabrieleMeoni GabrieleMeoni mentioned this pull request Nov 10, 2022
1 task
- Added checks whether activity functions are coroutines
- Added semahore to avoid running two activities
- Added test to see that double activity launching is prevented
@gomezzz gomezzz requested a review from johanos1 November 15, 2022 16:42
@johanos1 johanos1 self-requested a review November 18, 2022 10:38
if not self._was_stopped:
await self.stop()

async def stop(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gomezzz, I think this is could be the problem for the bug reported in #44. I would for this to be solved before finalizing #38

@gomezzz gomezzz requested a review from johanos1 November 22, 2022 17:42
@gomezzz gomezzz merged commit 1165658 into main Nov 23, 2022
@gomezzz
Copy link
Collaborator Author

gomezzz commented Nov 23, 2022

( merged as tests currently time out :S to be fixed)

@gomezzz gomezzz deleted the extend_activities branch November 23, 2022 12:25
@gomezzz gomezzz mentioned this pull request Nov 28, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature implementing a new feature physical-model All things involving some physical models tests Anything related to the tests user-facing Anything that users can interact with

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow activities to perform communications and maybe some task?

3 participants