NodeReputation class

Constructors

NodeReputation({required String deviceId, required double battery, required double storage, required int successfulInteractions, required int totalInteractions, required int requestedPackets, required int deliveredPackets, required double avgLatency, required int diversity, required int daysSinceLastInteraction, required List<double> weights, required String timestamp, bool hasHistory = false})
NodeReputation.fromMap(Map<String, dynamic> map)
factory

Properties

avgLatency double
getter/setter pair
battery double
getter/setter pair
canCooperatee bool
getter/setter pair
daysSinceLastInteraction int
getter/setter pair
deliveredPackets int
getter/setter pair
deviceId String
final
diversity int
getter/setter pair
filePath String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasHistory bool
getter/setter pair
pl double
final
reputation double
getter/setter pair
reputationThreshold double
final
requestedPackets int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sl double
final
storage double
getter/setter pair
successfulInteractions int
getter/setter pair
timestamp String
getter/setter pair
totalInteractions int
getter/setter pair
weights List<double>
final

Methods

calculateReputation() Future<void>
canCooperate() bool
init() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readHistory() Future<List<Map<String, dynamic>>>
resetHistory() Future<void>
startMonitoring({Duration interval = const Duration(minutes: 5)}) Future<void>
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

cooperationStatusString(NodeReputation node) String
readHistoryStatic(String devId) Future<List<Map<String, dynamic>>>