public code v1

This commit is contained in:
2026-05-22 11:14:29 +02:00
parent 427197ec5a
commit b8141736eb
28859 changed files with 575079 additions and 0 deletions
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -0,0 +1 @@
/bin/
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>afryca.consensusmodel.diego2020</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Diego2020
Bundle-SymbolicName: afryca.consensusmodel.diego2020;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Sinbad2
Automatic-Module-Name: afryca.consensusmodel.diego2020
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: afryca.consensusmodel
@@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="afryca.consensusmodel">
<ConsensusModel
ConsensusModel="afryca.consensusmodel.diego2020.Diego2020"
Information="Not yet"
MainFeatures="Not yet"
Multicriteria="false"
Name="Diego et al. 2020"
Observations="Not yet"
Structure="afryca.fpr"
WithFeedback="true"
id="afryca.consensusmodel.diego2020">
</ConsensusModel>
</extension>
</plugin>
@@ -0,0 +1,110 @@
package afryca.consensusmodel.diego2020;
import java.util.ArrayList;
import afryca.ase.RunnableScript;
import afryca.consensumodel.addon.E4DIAddon;
import afryca.consensusmodel.ConsensusEngine;
import afryca.consensusmodel.ConsensusModel;
import afryca.consensusmodel.definition.EResultElements;
import afryca.fpr.FPR;
import afryca.structure.Structure;
public class Diego2020 extends ConsensusModel {
private static final String CONSENSUS_MODEL_NAME = "Diego et al. (2020)"; //$NON-NLS-1$
private FPR[] preferencesWithoutGroup;
@Override
protected void setModelConfiguration() {
// TODO Auto-generated method stub
}
@Override
protected void obtainConfigurationValues() {
initializePreferencesWithoutGroup();
}
private void initializePreferencesWithoutGroup() {
preferencesWithoutGroup = new FPR[preferences.length - 1];
for (int i = 0; i < preferences.length - 1; i++) {
try {
preferencesWithoutGroup[i] = (FPR) preferences[i].clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
}
}
@Override
protected Float[][][] obtainVisualizeValues() {
Structure[] auxPreferences = clonePreferencesUnion(preferences, ConsensusEngine.groupPreferences(numberOfExperts, numberOfAlternatives, preferences));
Float[][][] preferencesGroupVisualization = new Float[numberOfExperts + 1][numberOfAlternatives][numberOfAlternatives];
for (int k = 0; k < numberOfExperts + 1; k++)
preferencesGroupVisualization[k] = auxPreferences[k].obtainVisualizeValues();
return preferencesGroupVisualization;
}
@Override
protected void preFirstSaveRoundResults() {
preSaveRoundResult(1, preferences, obtainVisualizeValues(), 0f);
result.put(EResultElements.initial_consensus_degree, 0f);
result.put(EResultElements.maxround, 1);
result.put(EResultElements.consensus_threshold, 0f);
result.put(EResultElements.consensus_model, CONSENSUS_MODEL_NAME);
}
@Override
protected void preSaveRoundResults() {
preSaveRoundResult(1, preferences,obtainVisualizeValues(), 0f);
}
@SuppressWarnings("unchecked")
@Override
protected void consensusRound() {
Double a = -1d/2d/Math.PI;
System.out.println("Llamando a ASE...");
ArrayList<FPR> preferencesResult = (ArrayList<FPR>) ((RunnableScript) E4DIAddon.aseService.createExecutionBuilder()
.setFunction("Sin")
.putVariable("preferences", preferencesWithoutGroup)
.putVariable("a", a)
.execute())
.getResult();
System.out.println();
System.out.println("Preferencias modificadas:");
for(FPR fpr: preferencesResult) {
System.out.println(fpr.prettyFormat());
System.out.println();
System.out.println();
}
}
@Override
protected void posSaveRoundResults() {
// TODO Auto-generated method stub
}
@Override
protected boolean mustBeCarriedOutAnotherRound() {
// TODO Auto-generated method stub
return false;
}
@Override
protected void saveExecutionResults() {
// TODO Auto-generated method stub
}
}