From bb64371a57a30d723cb425380ff6846d5d1ae931 Mon Sep 17 00:00:00 2001 From: AllanCapistrano Date: Sun, 24 Mar 2024 17:30:04 -0300 Subject: [PATCH] feat: using CalculateNodeReputationTask --- src/main/java/reputation/node/models/Node.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/reputation/node/models/Node.java b/src/main/java/reputation/node/models/Node.java index 07b3e1c..c42d68f 100644 --- a/src/main/java/reputation/node/models/Node.java +++ b/src/main/java/reputation/node/models/Node.java @@ -41,6 +41,7 @@ import reputation.node.reputation.credibility.NodeCredibility; import reputation.node.services.NodeTypeService; import reputation.node.tangle.LedgerConnector; +import reputation.node.tasks.CalculateNodeReputationTask; import reputation.node.tasks.ChangeDisturbingNodeBehaviorTask; import reputation.node.tasks.CheckDevicesTask; import reputation.node.tasks.CheckNodesServicesTask; @@ -766,6 +767,20 @@ private void createTasks() { 0, this.checkNodesServicesTaskTime * 1000 ); + new Timer() + .scheduleAtFixedRate( + new CalculateNodeReputationTask( + this, + new ReputationUsingKMeans( + this.kMeans, + this.nodeCredibility, + this.getNodeType().getNodeId() + ) + ), + 0, + this.calculateNodeReputationTaskTime * 1000 + ); + /* Somente se um nĂ³ do tipo perturbador. */ if (this.getNodeType().getType().toString().equals("DISTURBING")) { new Timer()