aboutsummaryrefslogtreecommitdiff
path: root/src/client/northstar/model
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-05-14 18:59:32 -0400
committerbob <bcz@cs.brown.edu>2019-05-14 18:59:32 -0400
commit281bfa589bd1ca66823003ca91cc11ce895fe5e2 (patch)
tree9380004d6bd4b7f8c6dbd497b9100b4142b869e4 /src/client/northstar/model
parent39e0f933fc446e70ae14006f8d9952822d798fe3 (diff)
fixes for northstar
Diffstat (limited to 'src/client/northstar/model')
-rw-r--r--src/client/northstar/model/ModelHelpers.ts10
-rw-r--r--src/client/northstar/model/idea/idea.ts6
2 files changed, 15 insertions, 1 deletions
diff --git a/src/client/northstar/model/ModelHelpers.ts b/src/client/northstar/model/ModelHelpers.ts
index ac807b41f..80bb71224 100644
--- a/src/client/northstar/model/ModelHelpers.ts
+++ b/src/client/northstar/model/ModelHelpers.ts
@@ -31,7 +31,15 @@ export class ModelHelpers {
}
public static GetAggregateParametersIndex(histogramResult: HistogramResult, aggParameters?: AggregateParameters): number {
- return ArrayUtil.IndexOfWithEqual(histogramResult.aggregateParameters!, aggParameters);
+ return Array.from(histogramResult.aggregateParameters!).findIndex((value, i, set) => {
+ if (set[i] instanceof CountAggregateParameters && value instanceof CountAggregateParameters)
+ return true;
+ if (set[i] instanceof MarginAggregateParameters && value instanceof MarginAggregateParameters)
+ return true;
+ if (set[i] instanceof SumAggregateParameters && value instanceof SumAggregateParameters)
+ return true;
+ return false;
+ });
}
public static GetAggregateParameter(distinctAttributeParameters: AttributeParameters | undefined, atm: AttributeTransformationModel): AggregateParameters | undefined {
diff --git a/src/client/northstar/model/idea/idea.ts b/src/client/northstar/model/idea/idea.ts
index 9d9d60678..c73a822c7 100644
--- a/src/client/northstar/model/idea/idea.ts
+++ b/src/client/northstar/model/idea/idea.ts
@@ -22,6 +22,9 @@ export abstract class AggregateParameters implements IAggregateParameters {
protected _discriminator: string;
+ public Equals(other: Object): boolean {
+ return this == other;
+ }
constructor(data?: IAggregateParameters) {
if (data) {
for (var property in data) {
@@ -204,6 +207,9 @@ export interface IAverageAggregateParameters extends ISingleDimensionAggregatePa
export abstract class AttributeParameters implements IAttributeParameters {
visualizationHints?: VisualizationHint[] | undefined;
rawName?: string | undefined;
+ public Equals(other: Object): boolean {
+ return this == other;
+ }
protected _discriminator: string;