Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend activities #36

Merged
merged 22 commits into from
Nov 23, 2022
Merged

Extend activities #36

merged 22 commits into from
Nov 23, 2022

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
paseos/activities/activity_manager.py Show resolved Hide resolved
paseos/activities/activity_manager.py Outdated Show resolved Hide resolved
paseos/activities/activity_manager.py Outdated Show resolved Hide resolved
paseos/activities/activity_manager.py Outdated Show resolved Hide resolved
paseos/activities/activity_manager.py Outdated Show resolved Hide resolved
paseos/paseos.py Outdated Show resolved Hide resolved
paseos/paseos.py Outdated Show resolved Hide resolved
paseos/paseos.py Outdated Show resolved Hide resolved
paseos/power/is_in_eclipse.py Show resolved Hide resolved
paseos/tests/activity_test.py Show resolved Hide resolved
- Added checks whether activity functions are coroutines
- Added semahore to avoid running two activities
- Added test to see that double activity launching is prevented
paseos/activities/activity_manager.py Show resolved Hide resolved
paseos/activities/activity_manager.py Show resolved Hide resolved
paseos/activities/activity_manager.py Show resolved Hide resolved
paseos/activities/activity_manager.py Show resolved Hide resolved
paseos/activities/activity_processor.py Show resolved Hide resolved
paseos/activities/activity_processor.py Outdated Show resolved Hide resolved
paseos/tests/activity_test.py Show resolved Hide resolved
paseos/tests/activity_test.py Outdated Show resolved Hide resolved
paseos/tests/activity_test.py Show resolved Hide resolved
paseos/tests/activity_test.py Show resolved Hide resolved
@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 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