TopsisLocalDatasourceImpl class

Implementation of TopsisLocalDatasource that handles TOPSIS algorithm operations.

This implementation supports:

  • Euclidean normalization
  • Identification of Positive (A+) and Negative (A-) Ideal Solutions
  • Separation measure calculations using Euclidean distance
  • Relative closeness coefficient calculation
  • Isolate-based processing for large datasets
  • Performance profiling

Example usage:

final datasource = TopsisLocalDatasourceImpl();

// Generate matrix
final rawMatrix = await datasource.generateTopsisMatrix(
  listAlternative: alternatives,
  listCriteria: criteria,
);

// Calculate results
final results = await datasource.calculateResult(rawMatrix: rawMatrix);
Implemented types
Mixed-in types

Constructors

TopsisLocalDatasourceImpl({DecisionMakingHelper? helper, DecisionIsolateMain? isolate, Stopwatch? stopwatch})
Creates an instance of TopsisLocalDatasourceImpl.

Properties

hashCode int
The hash code for this object.
no setterinherited
helper DecisionMakingHelper
no setteroverride
isolate DecisionIsolateMain
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateResult({required TopsisRawMatrix rawMatrix}) Future<List<WeightedDecisionResult>>
Calculates the final TOPSIS results from a decision matrix.
override
calculateResultWithExistingMatrix({required TopsisRawMatrix rawMatrix}) Future<List<WeightedDecisionResult>>
Calculates results using an existing matrix with validation and fixing.
override
ensureIdsForAlternatives(List<WeightedDecisionAlternative> alternatives) List<WeightedDecisionAlternative>
Ensures all alternatives have unique IDs.
inherited
ensureIdsForCriteria(List<WeightedDecisionCriteria> criteria) List<WeightedDecisionCriteria>
Ensures all criteria have unique IDs.
inherited
generateMatrixDirectly(List<WeightedDecisionAlternative> alternatives, List<WeightedDecisionCriteria> criteria) List<WeightedDecisionMatrix>
Generates matrix directly without using isolate.
inherited
generateMatrixWithIsolate(DecisionAlgorithm algorithm, DecisionProcessingIsolateCommand command, List<WeightedDecisionAlternative> alternatives, List<WeightedDecisionCriteria> criteria) Future<List<WeightedDecisionMatrix>>
Generates matrix using isolate for large datasets.
inherited
generateTopsisMatrix({required List<WeightedDecisionAlternative> listAlternative, required List<WeightedDecisionCriteria> listCriteria}) Future<TopsisRawMatrix>
Generates a TOPSIS raw decision matrix from the given alternatives and criteria.
override
normalizeCriteriaWeights(List<WeightedDecisionCriteria> criteria) List<WeightedDecisionCriteria>
Normalizes criteria weights to sum to exactly 100%.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateAndFixMatrix(List<WeightedDecisionMatrix> matrix) List<WeightedDecisionMatrix>
Validates and repairs matrix data structure.
inherited
validateInputs(List<WeightedDecisionAlternative> alternatives, List<WeightedDecisionCriteria> criteria) → void
Validates input data for matrix generation.
inherited
validateMaxInputValue(List<WeightedDecisionMatrix> matrix) Future<void>
Validates that all rating values do not exceed their criteria's maximum value.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited