From 3125bfed9ee5c7804822984f0380042f81585d93 Mon Sep 17 00:00:00 2001 From: AllanCapistrano Date: Fri, 15 Mar 2024 20:50:49 -0300 Subject: [PATCH] feat: writing the node service provider id in to the CSV file --- src/main/java/reputation/node/models/Node.java | 5 ++++- src/main/resources/OSGI-INF/blueprint/blueprint.xml | 2 +- .../resources/br.uefs.larsid.soft_iot.reputation_node.cfg | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/reputation/node/models/Node.java b/src/main/java/reputation/node/models/Node.java index c830760..0e5e946 100644 --- a/src/main/java/reputation/node/models/Node.java +++ b/src/main/java/reputation/node/models/Node.java @@ -84,7 +84,7 @@ public class Node implements NodeTypeService, ILedgerSubscriber { private NodeCredibility nodeCredibility; private CsvWriterService csvWriter; private String credibilityHeader; - private String[] csvData = new String[9]; + private String[] csvData = new String[10]; private long startedExperiment; private boolean flagStartedExperiment = true; private static final Logger logger = Logger.getLogger(Node.class.getName()); @@ -635,6 +635,9 @@ private void requestAndEvaluateNodeService( logger.info("EVALUATION VALUE"); logger.info(String.valueOf(evaluationValue)); + /* Salvando o ID do prestador do serviço. */ + this.csvData[9] = nodeId; + this.nodeType.getNode() .evaluateServiceProvider( nodeId, diff --git a/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/src/main/resources/OSGI-INF/blueprint/blueprint.xml index e9caa83..10305fc 100644 --- a/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -74,7 +74,7 @@ - + \ No newline at end of file diff --git a/src/main/resources/br.uefs.larsid.soft_iot.reputation_node.cfg b/src/main/resources/br.uefs.larsid.soft_iot.reputation_node.cfg index e95d2b6..65ec7ca 100644 --- a/src/main/resources/br.uefs.larsid.soft_iot.reputation_node.cfg +++ b/src/main/resources/br.uefs.larsid.soft_iot.reputation_node.cfg @@ -24,6 +24,6 @@ useCredibility=true useLatestCredibility=true # Cabeçalho do experimento de credibilidades. # Obs: Separe somente utilizando vírgula -credibilityHeader=Node_ID,Type,C(n),R,Tr(n),Cr_old(n),Cr_new(n),Started_experiment_time,wrote_file_time +credibilityHeader=Node_ID,Type,C(n),R,Tr(n),Cr_old(n),Cr_new(n),Started_experiment_time,wrote_file_time,Node_provider_ID debugModeValue=true \ No newline at end of file