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

Add Support for Predictive Scaling #49

Open
wants to merge 52 commits into
base: master
Choose a base branch
from

Conversation

berbjs
Copy link

@berbjs berbjs commented Sep 25, 2024

This PR implements things needed for the model changes proposed in PalladioSimulator/Palladio-Addons-SPD-Metamodel#32, notably:

  • For the newly introduced ModelBasedScalingPolicies:
    • Adds interpreters/switches for the new SPD metamodel objects (ModelInterpreter for the model, which returns the correct ModelEvaluator), modifies the SpdInterpreter to support the new ModelBasedScalingPolicy and the changed ReactiveScalingPolicy
    • Adds the ModelBasedTriggerChecker which receives MeasurementMade and RepeatedSimulationTimeReached events and uses a ModelEvaluator to decide whether a scaling action should happen (a more detailed EPC diagram is given below)
    • A RepeatedSimulationTimeReached event is added that repeats in some given interval and is used by Models to perform periodic operations such as scaling decisions. This event is re-scheduled by a new listener called RepeatedSimulationTimeRepeater
    • The SpdAdjustmentBehavior is changed to support Model-based scaling policies: For each (changed) transformation, a new configuration needs to be stored in the reconfigurator model cache
  • Reformatting of some code to fit the Palladio code style (at least as suggested by my Eclipse IDE) → this leads to the relatively large changes in some files
  • Add a RateOfChangeAggregation that performs a regression (using org.apache.commons.math3.stat.regression) to find out the rate of change, requiring a change of the aggregator data structure to DataPoints that contain both the value and the time of the stimulus output that is being aggregated

The ModelEvaluators for the different Models will be implemented in separate PRs (the current progress can be found in my fork) as this is already a quite large PR.

Finally, here's an EPC depicting the interaction between MeasurementMade/RepeatedSimulationTimeReached events and ModelAdjustmentRequested events based on the constructs added for the newly introduced ModelBasedScalingPolicy:
EPC-Eventflow-simplified

Also did a reformat (-> Palladio Code guidelines), that's why the change
is so large
Aggregation now (reliably) supports Utilization + Operation Response
Times.
The Number of Elements stimulus does not work yet as the
`MeasurementMade` event doesn't reach the Aggregator
- Use SlidingTimeWindowAggregation
- Add RateOfChange aggregation
This performs a linear regression and thus needs to know the time at
which datapoints have been measured - thus the Aggregations all have
DataPoints as input now and the WindowAggregation classes have been
changed accordingly
- Adds UtilizationRewardEvaluator
- Adds new Functions to FunctionRewardEvaluator
- Misc changes to interpreters
This caused the number of event handlers to grow exponentially and all
sorts of problems
Currently, the average over the last interval is taken for
non-aggregated stimuli
- Removed Reward entities
- Added reward evaluation to LearningBasedModelEvaluator
For reasoning see metamodel
This just changes the behavior from default-false to default-true, more
sophisticated behavior should probably be implemented
berbjs and others added 22 commits October 23, 2024 12:29
- Introduced convenience constructor
- Better documentation
- Support printing the trained model
- Improve readability by introducing new methods
- Remove unneeded methods
- Improve comments
- Improve reward + add fuzzy membership parameters
- Introduces AbstractFuzzyLearningModelEvaluator as abstract parent
class for Fuzzy SARSA + Q-Learning
- Add knowledge for initialization
- Exploration bonus at beginning
- Improved logging
- Changed reward to discourage scaling out
Also changes the reward for Q-Learning, still WIP
For interval: IntervalConstraint is used
For max container count: TargetGroupSizeConstraint is suggested
This should be better if the scaling action is somehow modified,
e.g. by some filters enforcing some constraints such as a thrashing
constraint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant