riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
202 stars 128 forks source link

Storyboard Effects #294

Closed Ambica2022 closed 9 months ago

Ambica2022 commented 1 year ago

Hi,

How to reapply or stop the storyboard effects? I tried with removeEffect() from StopEffect class and it is giving error as StopEffect has no method called removeEffect()....but actually it does have along with applyEffect() and reapplyEffect() methods.

Can anyone have experience with this. Thank you.

Regards, Ambica

riebl commented 1 year ago

Hi @Ambica2022,

have a look at src/artery/storyboard/EffectStack.cc which handles the active effects.

Ambica2022 commented 12 months ago

Hi @Ambica2022,

have a look at src/artery/storyboard/EffectStack.cc which handles the active effects.

Hi @riebl ,

Thank you. I guess that effects are added to the stack automatically when applied from .py file and try to remove the effects from a DENM use case(.cc) file as follows.

include "artery/storyboard/EffectStack.h"

void Stationary::handleStoryboardTrigger(const StoryboardSignal& signal) { EffectStack mEs; mEs.removeEffectsByStory(signal.getStory()); ... .... .... }

the error is

error

Is anything considered wrong from my code?

Regards, Ambica

riebl commented 11 months ago

The Storyboard module maintains the effect stacks for each vehicle internally. Manually removing effects applied by a story a not part of the concept. Instead, you should modify the triggering conditions of the story which has originally applied the effect: When its conditions are no longer met, the effect stack will be updated accordingly.

Your code snippet just tries to modify an EffectStack object locally created in your method. That will definitely not work.

Last but not least, regarding the shown error message: The environment model does not link to the storyboard because both are independent features. Hence, you cannot call storyboard code from the environment model. However, your model which depends on both can do this without problems. This is a problem in your code organisation.

Ambica2022 commented 9 months ago

Thank you Riebl.