public code v1
This commit is contained in:
@@ -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,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>flintstones.group</groupId>
|
||||
<artifactId>flintstones.bundles</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>flintstones.method.fuzzy.common.phase.aggregation.ui</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Bundle-Name</name>
|
||||
</project>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.method.fuzzy.common.phase.aggregation.ui</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>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1779484362673</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
+9
@@ -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
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -0,0 +1,21 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: flintstones.method.fuzzy.common.phase.aggregation.ui;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Automatic-Module-Name: flintstones.method.fuzzy.common.phase.aggregation.ui
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Require-Bundle: org.eclipse.e4.core.services,
|
||||
javax.inject,
|
||||
flintstones.entity.method.phase.ui,
|
||||
flintstones.model.valuation.service,
|
||||
flintstones.operator,
|
||||
org.eclipse.swt,
|
||||
flintstones.helper.html,
|
||||
flintstones.entity.method.phase,
|
||||
flintstones.method.fuzzy.common.phase.aggregation,
|
||||
flintstones.model.ui.service,
|
||||
flintstones.entity.problemelement,
|
||||
flintstones.domain.fuzzyset,
|
||||
flintstones.entity.operator,
|
||||
flintstones.valuation.fuzzy
|
||||
@@ -0,0 +1,5 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="flintstones.phasemethod.ui">
|
||||
<phasemethod_ui
|
||||
implementation="flintstones.method.fuzzy.common.phase.aggregation.ui.FuzzyAggregationUI"
|
||||
phasemethod="flintstones.method.fuzzy.common.phase.aggregation"
|
||||
uid="flintstones.method.fuzzy.common.phase.aggregation.ui">
|
||||
</phasemethod_ui>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
+482
@@ -0,0 +1,482 @@
|
||||
package flintstones.method.fuzzy.common.phase.aggregation.ui;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import flintstones.domain.fuzzyset.function.types.TrapezoidalFunction;
|
||||
import flintstones.entity.method.phase.ui.PhaseMethodUI;
|
||||
import flintstones.entity.operator.AggregationOperator;
|
||||
import flintstones.entity.problemelement.entities.Alternative;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.helper.html.table.HtmlTextTable;
|
||||
import flintstones.method.fuzzy.common.phase.aggregation.FuzzyAggregation;
|
||||
import flintstones.method.fuzzy.common.phase.aggregation.ui.messages.Messages;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
import flintstones.model.valuation.service.IValuationService;
|
||||
import flintstones.operator.service.IOperatorService;
|
||||
import flintstones.valuation.fuzzy.FuzzyValuation;
|
||||
|
||||
public class FuzzyAggregationUI extends PhaseMethodUI{
|
||||
|
||||
@Inject
|
||||
IValuationService valuationService;
|
||||
|
||||
@Inject
|
||||
IOperatorService operatorService;
|
||||
|
||||
@Inject
|
||||
@Translation
|
||||
Messages msg;
|
||||
|
||||
/**
|
||||
* Class model implementation
|
||||
*/
|
||||
FuzzyAggregation model;
|
||||
|
||||
/**
|
||||
* Left side composite
|
||||
*/
|
||||
Composite compLeft;
|
||||
|
||||
/**
|
||||
* Right side composite
|
||||
*/
|
||||
Composite compRight;
|
||||
|
||||
/**
|
||||
* Combo for expert selection
|
||||
*/
|
||||
Combo expertsCombo;
|
||||
|
||||
/**
|
||||
* Aggregation operator selector for valuations
|
||||
*/
|
||||
Combo comboValuations;
|
||||
|
||||
/**
|
||||
* Aggregation operator selector for criteria weights
|
||||
*/
|
||||
Combo comboWeights;
|
||||
|
||||
/**
|
||||
* Selected aggregation operator for valuations
|
||||
*/
|
||||
AggregationOperator operatorValuations;
|
||||
|
||||
/**
|
||||
* Selected aggregation operator for criteria weights
|
||||
*/
|
||||
AggregationOperator operatorWeights;
|
||||
|
||||
/**
|
||||
* Left table (initial experts valuations)
|
||||
*/
|
||||
HtmlTextTable initialTable;
|
||||
|
||||
/**
|
||||
* Initial weights table
|
||||
*/
|
||||
HtmlTextTable initialWeTable;
|
||||
|
||||
/**
|
||||
* Expert selected index
|
||||
*/
|
||||
int selectedExpert;
|
||||
|
||||
/**
|
||||
* Right table (aggregation result)
|
||||
*/
|
||||
HtmlTextTable resultTable;
|
||||
|
||||
/**
|
||||
* Aggregated weights table
|
||||
*/
|
||||
HtmlTextTable resultWeigthsTable;
|
||||
|
||||
/**
|
||||
* Button to enable tag name view
|
||||
*/
|
||||
Button nameOrValue;
|
||||
|
||||
/**
|
||||
* Inits interface
|
||||
*/
|
||||
@Override
|
||||
public void init() {
|
||||
model = (FuzzyAggregation) this.getModel();
|
||||
model.loadData();
|
||||
|
||||
Composite base = this.getBaseComposite();
|
||||
UiService.setGridData(base, 9, 9, true, true);
|
||||
UiService.setGridLayout(base, 3);
|
||||
|
||||
Composite leftTable = new Composite(base, SWT.BORDER);
|
||||
UiService.setGridData(leftTable, 9, 9, true, true);
|
||||
UiService.setGridLayout(leftTable, 1);
|
||||
|
||||
Composite comboComposite = new Composite(leftTable, SWT.NONE);
|
||||
UiService.setGridData(comboComposite, 0, 1, true, false);
|
||||
UiService.setGridLayout(comboComposite, 2);
|
||||
|
||||
// <--------Make expert selector-------->
|
||||
Label labelExpertTable = new Label(comboComposite, SWT.NONE);
|
||||
UiService.setGridData(labelExpertTable, 9, 0, false, false);
|
||||
labelExpertTable.setText(msg.expert_select);
|
||||
|
||||
createExpertCombo(comboComposite);
|
||||
createExpertValuationTable(leftTable);
|
||||
createExpertWeightsTable(leftTable);
|
||||
|
||||
// <--------Make operator selectors-------->
|
||||
Composite selectOperators = new Composite(base, SWT.BORDER);
|
||||
UiService.setGridData(selectOperators, 0, 0, false, true);
|
||||
UiService.setGridLayout(selectOperators, 1);
|
||||
|
||||
Label selectOperatorValuationLabel = new Label(selectOperators, SWT.NONE);
|
||||
selectOperatorValuationLabel.setText("Select operator for aggregation");
|
||||
|
||||
Composite comboBase = new Composite(selectOperators, SWT.NONE);
|
||||
UiService.setGridData(comboBase, 0, 0, true, true);
|
||||
UiService.setGridLayout(comboBase, 1);
|
||||
|
||||
Label selectOperatorWeightLabel = new Label(selectOperators, SWT.NONE);
|
||||
selectOperatorWeightLabel.setText("Select operator for weights aggregation");
|
||||
|
||||
Composite comboBase2 = new Composite(selectOperators, SWT.NONE);
|
||||
UiService.setGridData(comboBase2, 0, 0, true, true);
|
||||
UiService.setGridLayout(comboBase2, 1);
|
||||
|
||||
// <--------Make final composite-------->
|
||||
Composite tablaDer = new Composite(base, SWT.BORDER);
|
||||
UiService.setGridData(tablaDer, 9, 9, true, true);
|
||||
UiService.setGridLayout(tablaDer, 1);
|
||||
|
||||
Label aggrLabel = new Label(tablaDer, SWT.NONE);
|
||||
aggrLabel.setText(msg.agg_values);
|
||||
UiService.setGridData(aggrLabel, 0, 0, false, false);
|
||||
|
||||
// <--------Make operator selectors-------->
|
||||
comboValuations = new Combo(comboBase, SWT.NONE);
|
||||
comboWeights = new Combo(comboBase2, SWT.NONE);
|
||||
|
||||
if (model.getExperts().length == 1) {//One expert
|
||||
comboValuations.setEnabled(false);
|
||||
comboWeights.setEnabled(false);
|
||||
|
||||
createExpertValuationTable(tablaDer);
|
||||
|
||||
Label aggrWeightsLabel = new Label(tablaDer, SWT.NONE);
|
||||
aggrWeightsLabel.setText(msg.aggWeTag);
|
||||
UiService.setGridData(aggrWeightsLabel, 0, 0, false, false);
|
||||
|
||||
createExpertWeightsTable(tablaDer);
|
||||
|
||||
} else { // Several experts
|
||||
|
||||
// <--------Get aggregation operators-------->
|
||||
AggregationOperator[] operators = operatorService.getAggregationOperatorsFor(FuzzyValuation.ID, true);
|
||||
String[] operatorsName = new String[operators.length];
|
||||
|
||||
for (int i = 0; i < operators.length; ++i)
|
||||
operatorsName[i] = operators[i].getName();
|
||||
|
||||
comboValuations.setItems(operatorsName);
|
||||
comboValuations.select(0);
|
||||
operatorValuations = operators[0];
|
||||
|
||||
comboValuations.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
for (int i = 0; i < operators.length; i++) {
|
||||
if (comboValuations.getText().equals(operators[i].getName())) {
|
||||
operatorValuations = operators[i];
|
||||
i = operators.length;
|
||||
}
|
||||
}
|
||||
|
||||
refreshCollectiveData();
|
||||
|
||||
model.exportData();
|
||||
}
|
||||
});
|
||||
|
||||
comboWeights.setItems(operatorsName);
|
||||
comboWeights.select(0);
|
||||
operatorWeights = operators[0];
|
||||
|
||||
comboWeights.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
for (int i = 0; i < operators.length; i++) {
|
||||
if (comboWeights.getText().equals(operators[i].getName())) {
|
||||
operatorWeights = operators[i];
|
||||
i = operators.length;
|
||||
}
|
||||
}
|
||||
|
||||
refreshCollectiveData();
|
||||
|
||||
model.exportData();
|
||||
}
|
||||
});
|
||||
|
||||
createAggregatedValuationsTable(tablaDer);
|
||||
|
||||
Label aggrWeightsLabel = new Label(tablaDer, SWT.NONE);
|
||||
aggrWeightsLabel.setText(msg.aggWeTag);
|
||||
UiService.setGridData(aggrWeightsLabel, 0, 0, false, false);
|
||||
|
||||
createAggregatedWeightsTable(tablaDer);
|
||||
}
|
||||
|
||||
model.exportData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes expert selector
|
||||
* @param comboComposite
|
||||
*/
|
||||
private void createExpertCombo(Composite comboComposite) {
|
||||
expertsCombo = new Combo(comboComposite, SWT.NONE);
|
||||
UiService.setGridData(expertsCombo, 0, 0, false, false);
|
||||
|
||||
for (int i = 0; i < model.getExperts().length; i++)
|
||||
expertsCombo.add(model.getExperts()[i].getName());
|
||||
|
||||
expertsCombo.select(0);
|
||||
expertsCombo.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
refreshIndividualData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes inital data table with first expert
|
||||
*
|
||||
* @param base Table composite
|
||||
*/
|
||||
void createExpertValuationTable(Composite base) {
|
||||
|
||||
String[] alternatives = new String[model.getAlternatives().length];
|
||||
String[] criteria = new String[model.getCriteria().length];
|
||||
|
||||
for (int i = 0; i < alternatives.length; i++)
|
||||
alternatives[i] = model.getAlternatives()[i].toString();
|
||||
|
||||
for (int i = 0; i < criteria.length; i++)
|
||||
criteria[i] = model.getCriteria()[i].toString();
|
||||
|
||||
String[][] valuations = getExpertValuations(alternatives.length, criteria.length, expertsCombo.getSelectionIndex());
|
||||
|
||||
Composite compositeTable = new Composite(base, SWT.NONE);
|
||||
UiService.setGridData(compositeTable, 9, 9, true, true);
|
||||
UiService.setGridLayout(compositeTable, 1);
|
||||
|
||||
initialTable = new HtmlTextTable(compositeTable, valuations, criteria, alternatives);
|
||||
initialTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rows Number of alternatives
|
||||
* @param cols Numer of criteria
|
||||
* @param expertIndex Index of the expert
|
||||
* @return Expert collected valuations as String array matrix
|
||||
*/
|
||||
private String[][] getExpertValuations(int rows, int cols, int expertIndex) {
|
||||
String[][] valuations = new String[rows][cols];
|
||||
|
||||
for (int i = 0; i < valuations.length; i++) {
|
||||
for (int j = 0; j < valuations[i].length; j++)
|
||||
valuations[i][j] = model.getStringExpertValuation(expertIndex, i, j);
|
||||
}
|
||||
|
||||
return valuations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make collected weights table
|
||||
*
|
||||
* @param base Table composite
|
||||
*/
|
||||
private void createExpertWeightsTable(Composite base) {
|
||||
String[] criteria = new String[model.getCriteria().length];
|
||||
String[] weights = new String[model.getCriteria().length];
|
||||
|
||||
int index = expertsCombo.getSelectionIndex();
|
||||
TrapezoidalFunction[] expertWeights = model.getExpertWeights(index);
|
||||
|
||||
Criterion crit;
|
||||
for (int i = 0; i < criteria.length; i++) {
|
||||
crit = model.getCriteria()[i];
|
||||
criteria[i] = crit.toString();
|
||||
weights[i] = expertWeights[i].toString();
|
||||
}
|
||||
|
||||
Composite compositeTable = new Composite(base, SWT.NONE);
|
||||
UiService.setGridData(compositeTable, 9, 9, true, true);
|
||||
UiService.setGridLayout(compositeTable, 1);
|
||||
|
||||
initialWeTable = new HtmlTextTable(compositeTable, weights, criteria, false);
|
||||
initialWeTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes aggregated valuations table
|
||||
*
|
||||
* @param base Table composite
|
||||
*/
|
||||
void createAggregatedValuationsTable(Composite base) {
|
||||
model.computeAggregatedMatrix(operatorValuations);
|
||||
|
||||
Alternative[] alternatives = model.getAlternatives();
|
||||
String[] alternatives_names = new String[model.getAlternatives().length];
|
||||
|
||||
Criterion[] criteria = model.getCriteria();
|
||||
String[] criteria_names = new String[model.getCriteria().length];
|
||||
|
||||
String[][] valuations = new String[alternatives.length][criteria.length];
|
||||
|
||||
for (int i = 0; i < alternatives.length; i++)
|
||||
alternatives_names[i] = alternatives[i].toString();
|
||||
|
||||
for (int i = 0; i < criteria.length; i++)
|
||||
criteria_names[i] = criteria[i].toString();
|
||||
|
||||
for (int i = 0; i < valuations.length; i++) {
|
||||
for (int j = 0; j < valuations[i].length; j++)
|
||||
valuations[i][j] = model.getAggregatedValuation(alternatives[i], criteria[j]).toString();
|
||||
}
|
||||
|
||||
Composite tabla = new Composite(base, SWT.NONE);
|
||||
UiService.setGridData(tabla, 9, 9, true, true);
|
||||
UiService.setGridLayout(tabla, 1);
|
||||
|
||||
resultTable = new HtmlTextTable(tabla, valuations, criteria_names, alternatives_names);
|
||||
resultTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes aggregated weights table
|
||||
*
|
||||
* @param base Table composite
|
||||
*/
|
||||
void createAggregatedWeightsTable(Composite base) {
|
||||
model.computeAggregatedWeights(operatorWeights);
|
||||
|
||||
Criterion[] criteria = model.getCriteria();
|
||||
String[] criteria_names = new String[model.getCriteria().length];
|
||||
for (int i = 0; i < criteria.length; i++)
|
||||
criteria_names[i] = criteria[i].toString();
|
||||
|
||||
String[] weights = new String[model.getCriteria().length];
|
||||
|
||||
for (int i = 0; i < criteria.length; i++)
|
||||
weights[i] = model.getAggregatedWeight(i).toString();
|
||||
|
||||
Composite tabla = new Composite(base, SWT.NONE);
|
||||
UiService.setGridData(tabla, 9, 9, true, true);
|
||||
UiService.setGridLayout(tabla, 1);
|
||||
|
||||
resultWeigthsTable = new HtmlTextTable(tabla, weights, criteria_names, false);
|
||||
resultWeigthsTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload initial data and weights tables
|
||||
*/
|
||||
private void refreshIndividualData() {
|
||||
refreshExpertValuationTable();
|
||||
refreshExpertWeightTable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload aggregated valuations and weights tables
|
||||
*/
|
||||
private void refreshCollectiveData() {
|
||||
refreshCollectionValuationTable();
|
||||
refreshCollectiveWeightTable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads phase tables
|
||||
*/
|
||||
@Override
|
||||
public void refresh() {
|
||||
refreshIndividualData();
|
||||
refreshCollectiveData();
|
||||
this.sendRefresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates initial table data
|
||||
*/
|
||||
private void refreshExpertValuationTable() {
|
||||
String[][] valuations = getExpertValuations(model.getAlternatives().length, model.getCriteria().length, expertsCombo.getSelectionIndex());
|
||||
initialTable.refresh(valuations);
|
||||
initialTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates criterion weights table
|
||||
*/
|
||||
private void refreshExpertWeightTable() {
|
||||
TrapezoidalFunction[] expertWeights = model.getExpertWeights(expertsCombo.getSelectionIndex());
|
||||
|
||||
String[] weights = new String[model.getCriteria().length];
|
||||
for (int i = 0; i < model.getCriteria().length; i++)
|
||||
weights[i] = expertWeights[i].toString();
|
||||
|
||||
initialWeTable.refresh(weights);
|
||||
initialWeTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates aggregated valuations table
|
||||
*/
|
||||
private void refreshCollectionValuationTable() {
|
||||
model.computeAggregatedMatrix(operatorValuations);
|
||||
|
||||
Alternative[] alternatives = model.getAlternatives();
|
||||
Criterion[] criteria = model.getCriteria();
|
||||
|
||||
String[][] valuations = new String[model.getAlternatives().length][model.getCriteria().length];
|
||||
for (int i = 0; i < model.getAlternatives().length; i++) {
|
||||
for (int j = 0; j < model.getCriteria().length; j++)
|
||||
valuations[i][j] = model.getAggregatedValuation(alternatives[i], criteria[j]).toString();
|
||||
}
|
||||
|
||||
resultTable.refresh(valuations);
|
||||
resultTable.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates aggregated weights table
|
||||
*/
|
||||
private void refreshCollectiveWeightTable() {
|
||||
model.computeAggregatedWeights(operatorWeights);
|
||||
|
||||
String[] weights = new String[model.getCriteria().length];
|
||||
|
||||
for (int i = 0; i < model.getCriteria().length; i++)
|
||||
weights[i] = model.getAggregatedWeight(i).toString();
|
||||
|
||||
resultWeigthsTable.refresh(weights);
|
||||
resultWeigthsTable.render();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForwardEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package flintstones.method.fuzzy.common.phase.aggregation.ui.messages;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Message;
|
||||
|
||||
@Message
|
||||
public class Messages {
|
||||
public String expert_select;
|
||||
public String show_alt_names;
|
||||
public String agg_values;
|
||||
public String iniWeTag;
|
||||
public String aggWeTag;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
expert_select=Select expert
|
||||
show_alt_names=Show names
|
||||
agg_values=Aggregated valuations
|
||||
iniWeTag=Initial weights
|
||||
aggWeTag=Aggregated weights
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
expert_select=Seleccionar experto
|
||||
show_alt_names=Ver nombres
|
||||
agg_values=Valoraciones agregadas
|
||||
iniWeTag=Pesos iniciales
|
||||
aggWeTag=Pesos agregados
|
||||
Reference in New Issue
Block a user