Skip to content

Commit

Permalink
yarn fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcook1186 authored and gnanakeethan committed Sep 15, 2023
1 parent 2ee7a85 commit 69874f5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/lib/case-studies/eshoppen-model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IImpactModelInterface } from '../interfaces';
import { KeyValuePair } from '../../types/boavizta';
import {IImpactModelInterface} from '../interfaces';
import {KeyValuePair} from '../../types/boavizta';

export class EshoppenModel implements IImpactModelInterface {
authParams: object | undefined = undefined;
Expand All @@ -21,11 +21,12 @@ export class EshoppenModel implements IImpactModelInterface {
switch (this.modelType) {
case 'e-cpu': {
// e-cpu = n-hours * n-chips * tdp * tdp-coeff
observation['e-cpu'] = (
observation['n-hours'] *
observation['n-chips'] *
observation['tdp'] *
observation['tdp-coeff']) / 1000;
observation['e-cpu'] =
(observation['n-hours'] *
observation['n-chips'] *
observation['tdp'] *
observation['tdp-coeff']) /
1000;
if (isNaN(observation['e-cpu'])) {
throw new Error('e-cpu not computable');
}
Expand All @@ -37,7 +38,8 @@ export class EshoppenModel implements IImpactModelInterface {
(observation['n-hours'] *
observation['n-chips'] *
observation['tdp-mem'] *
observation['tdp-coeff']) / 1000;
observation['tdp-coeff']) /
1000;
if (isNaN(observation['e-mem'])) {
throw new Error('e-mem not computable');
}
Expand All @@ -47,7 +49,8 @@ export class EshoppenModel implements IImpactModelInterface {
// e-net = data-in + data-out * net-energy
observation['e-net'] =
((observation['data-in'] + observation['data-out']) *
observation['net-energy']) / 1000;
observation['net-energy']) /
1000;
if (isNaN(observation['e-net'])) {
throw new Error('e-net not computable');
}
Expand All @@ -56,7 +59,7 @@ export class EshoppenModel implements IImpactModelInterface {
case 'e-sum': {
// e-sum = e-cpu + e-mem + e-net
observation['energy'] =
(observation['e-cpu'] + observation['e-mem'] + observation['e-net']);
observation['e-cpu'] + observation['e-mem'] + observation['e-net'];
if (isNaN(observation['energy'])) {
throw new Error('energy not computable');
}
Expand Down

0 comments on commit 69874f5

Please sign in to comment.