AhpLocalDatasourceImpl class

Implementation of AhpLocalDatasource that handles AHP algorithm operations.

This implementation supports:

  • Automatic ID generation for all entities
  • Isolate-based processing for large datasets (>15 criteria or alternatives)
  • Performance profiling for optimization
  • Comprehensive validation and error handling
  • Consistency ratio checking for result validation

AHP Process Flow:

  1. Identification → validates and assigns IDs
  2. Generate Hierarchy → creates decision structure
  3. Generate Pairwise Inputs → creates comparison templates
  4. User fills in comparisons (external to this class)
  5. Calculate Final Score → computes results

Example usage:

final datasource = AhpLocalDatasourceImpl();

// Step 1: Identify
final identification = await datasource.identification(criteria, alternatives);

// Step 2: Generate hierarchy
final hierarchy = await datasource.generateHierarchy(
  identification.criteria,
  identification.alternative,
);

// Step 3: Generate comparison templates
final criteriaInputs = await datasource.generatePairwiseCriteria(
  identification.criteria,
);
final alternativeInputs = await datasource.generatePairwiseAlternative(hierarchy);

// Step 4: User fills in comparisons (your UI logic here)

// Step 5: Calculate results
final result = await datasource.calculateFinalScore(
  hierarchy,
  criteriaInputs,
  alternativeInputs,
);
Inheritance

Constructors

AhpLocalDatasourceImpl({DecisionMakingHelper? helper, DecisionIsolateMain? isolateMain})
Creates an instance of AhpLocalDatasourceImpl.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateFinalScore(List<AhpHierarchy> hierarchy, List<PairwiseComparisonInput> inputsCriteria, List<PairwiseAlternativeInput> inputsAlternative) Future<AhpResult>
override
generateHierarchy(List<AhpItem> criteria, List<AhpItem> alternative) Future<List<AhpHierarchy>>
GENERATE STRUCTURE HIERARCHY
override
generatePairwiseAlternative(List<AhpHierarchy> nodes) Future<List<PairwiseAlternativeInput>>
override
generatePairwiseCriteria(List<AhpItem> criteria) Future<List<PairwiseComparisonInput>>
GENERATE PAIRWISE CRITERIA INPUTS
override
identification(List<AhpItem> criteria, List<AhpItem> alternative) Future<AhpIdentification>
IDENTIFICATION DETAIL
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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