diff --git a/src/main/java/reputation/node/models/Node.java b/src/main/java/reputation/node/models/Node.java index cdcf1f3..c830760 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[8]; + private String[] csvData = new String[9]; private long startedExperiment; private boolean flagStartedExperiment = true; private static final Logger logger = Logger.getLogger(Node.class.getName()); @@ -806,11 +806,13 @@ private float calculateCredibility( currentServiceEvaluation ); - /* Salvando o ID, consistência, confiabilidade e credibilidade mais recente. */ + /* Salvando o ID, tipo, consistência, confiabilidade e credibilidade mais + recente. */ this.csvData[0] = String.valueOf(this.nodeType.getNodeId()); - this.csvData[1] = String.valueOf(consistency); - this.csvData[3] = String.valueOf(trustworthiness); - this.csvData[4] = String.valueOf(nodeCredibility); + this.csvData[1] = this.getNodeType().getType().toString(); + this.csvData[2] = String.valueOf(consistency); + this.csvData[4] = String.valueOf(trustworthiness); + this.csvData[5] = String.valueOf(nodeCredibility); logger.info("TRUSTWORTHINESS"); logger.info(String.valueOf(trustworthiness)); @@ -858,7 +860,7 @@ private float calculateCredibility( } /* Salvando a nova credibilidade. */ - this.csvData[5] = String.valueOf(nodeCredibility); + this.csvData[6] = String.valueOf(nodeCredibility); logger.info("NEW NODE CREDIBILITY"); logger.info(String.valueOf(nodeCredibility)); @@ -868,9 +870,9 @@ private float calculateCredibility( startedExperiment = System.currentTimeMillis(); flagStartedExperiment = false; } - this.csvData[6] = String.valueOf(startedExperiment); + this.csvData[7] = String.valueOf(startedExperiment); /* Salvando o tempo em que calculou a nova credibilidade. */ - this.csvData[7] = String.valueOf(System.currentTimeMillis()); + this.csvData[8] = String.valueOf(System.currentTimeMillis()); /* Escrevendo na blockchain a credibilidade calculado do nó avaliador */ try { @@ -986,7 +988,7 @@ private float calculateTrustworthiness( } /* Salvando R. */ - this.csvData[2] = String.valueOf(R); + this.csvData[3] = String.valueOf(R); logger.info("R VALUE"); logger.info(String.valueOf(R)); diff --git a/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/src/main/resources/OSGI-INF/blueprint/blueprint.xml index 22291f1..e9caa83 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 62742ad..e95d2b6 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,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 debugModeValue=true \ No newline at end of file