Add the price model#286
Conversation
Codecov Report
@@ Coverage Diff @@
## v0.2 #286 +/- ##
==========================================
+ Coverage 65.92% 68.75% +2.82%
==========================================
Files 115 115
Lines 6098 6128 +30
==========================================
+ Hits 4020 4213 +193
+ Misses 2078 1915 -163
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
|
||
| def _update_energy_consumption_cost(self): | ||
| for pm in self._machines: | ||
| pm_cost = pm.energy_consumption * (self._unit_energy_price / 1000.0) * self._power_usage_efficiency |
There was a problem hiding this comment.
if you need to divide a constant in code, why not directly modify the factor in config?
| PRICE_PER_MEMORY: 0.0078 | ||
| # The parameters refer to https://www.microsoft.com/en-us/research/wp-content/uploads/2009/01/p68-v39n1o-greenberg.pdf | ||
| # Unit price of Energy | ||
| UNIT_ENERGY_PRICE: 0.07 |
|
|
||
| if self._kill_all_vms_if_overload: | ||
| for vm_id in vm_ids: | ||
| self._total_incomes -= self._live_vms[vm_id].get_income_till_now(tick) |
There was a problem hiding this comment.
since overload is called before be._update_income; and the vm.get_income_till_now will take the income of current tick into account. one more unit_price is decreased?
There was a problem hiding this comment.
How do you solve it? You didn't reply me.
| @@ -0,0 +1,8 @@ | |||
| env: | |||
| scenario: vm_scheduling | |||
| topology: azure.2019.10k | |||
There was a problem hiding this comment.
use a toy topology instead. It's better to "debug". and better to be used for UnitTest here.
| vm_id=decision_event.vm_id, | ||
| pm_id=decision_event.valid_pms[0] | ||
| ) | ||
| self.metrics, decision_event, is_done = env.step(action) |
There was a problem hiding this comment.
image that you are designing the test cases. If I told your final metrics are wrong, the thing you need to do is using a toy case (so that you can know the output of every step), and compare the output of the program to the correct output.
Not run the whole program to check if it is aligned with your current output. You never know whether your current output is correct or not.
|
|
||
| if self._kill_all_vms_if_overload: | ||
| for vm_id in vm_ids: | ||
| self._total_incomes -= self._live_vms[vm_id].get_income_till_now(tick) |
There was a problem hiding this comment.
How do you solve it? You didn't reply me.
| @@ -0,0 +1,8 @@ | |||
| env: | |||
| scenario: vm_scheduling | |||
| topology: azure.2019.10k | |||
| topology: azure.2019.10k | ||
| start_tick: 1 | ||
| durations: 8638 | ||
| resolution: 1 |
There was a problem hiding this comment.
Also, besides the topology problem. Since it is also for a specific test, the configs in this file can also be written down in the code directly.
| @@ -511,7 +510,6 @@ def post_step(self, tick: int): | |||
| # Update the energy consumption cost. | |||
| pm_cost = ( | |||
| pm.energy_consumption | |||
There was a problem hiding this comment.
I wonder if the unit of energy_consumption should be kwh or not?
| @@ -0,0 +1,69 @@ | |||
| # Initial buffer time budget. | |||
| BUFFER_TIME_BUDGET: 0 | |||
There was a problem hiding this comment.
refer to tests/citi_bike/test_bike_scenario.py
and tests/data/citi_bike/case_1
move the test data and config to under test/ folder
Description
Linked issue(s)/Pull request(s)
Type of Change
Related Component
Has Been Tested
Needs Follow Up Actions
Checklist