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
+7
View File
@@ -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-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+1
View File
@@ -0,0 +1 @@
/bin/
+39
View File
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>afryca.simulation</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.pde.ds.core.builder</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>
</projectDescription>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
line.separator=\n
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
@@ -0,0 +1,25 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: afryca.simulation;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Export-Package: afryca.simulation,
afryca.simulation.command,
afryca.simulation.service,
afryca.simulation.service.events
Require-Bundle: afryca.ase,
afryca.gdmp;visibility:=reexport,
afryca.behavior;visibility:=reexport,
afryca.consensusmodel;visibility:=reexport,
org.eclipse.core.runtime,
org.eclipse.e4.core.di,
org.eclipse.e4.core.di.extensions,
org.eclipse.e4.core.contexts,
org.eclipse.e4.core.services,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.model.workbench
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Service-Component: OSGI-INF/simulation_service_context_function.xml
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: afryca.simulation
@@ -0,0 +1,11 @@
#Properties file for afryca.simulation
afryca.simulation.command.deselect_alternative.description = Deselect alternative
afryca.simulation.command.deselect_alternative.name = &Deselect alternative
afryca.simulation.command.deselect_criterion.description = Deselect criterion
afryca.simulation.command.deselect_criterion.name = &Deselect criterion
afryca.simulation.command.deselect_expert.description = Deselect expert
afryca.simulation.command.deselect_expert.name = &Deselect expert
afryca.simulation.command.simulate.description = Simulate consensus reaching process
afryca.simulation.command.simulate.name = &Simulate
Bundle-Name = Simulation
Bundle-Vendor = Sinbad\u00B2
@@ -0,0 +1,11 @@
#Archivo de propiedades para afryca.simulation
afryca.simulation.command.deselect_alternative.description = Deseleccionar alternative
afryca.simulation.command.deselect_alternative.name = &Deseleccionar alternativa
afryca.simulation.command.deselect_criterion.description = Deseleccionar criterio
afryca.simulation.command.deselect_criterion.name = &Deseleccionar criterio
afryca.simulation.command.deselect_expert.description = Deseleccionar experto
afryca.simulation.command.deselect_expert.name = &Deseleccionar experto
afryca.simulation.command.simulate.description = Simular proceso de alcance de consenso
afryca.simulation.command.simulate.name = &Simular
Bundle-Name = Simulación
Bundle-Vendor = Sinbad\u00B2
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="ISimulationService context function">
<implementation class="afryca.simulation.service.provider.SimulationServiceContextFunction"/>
<property
name="service.context.key"
type="String"
value="afryca.simulation.service.ISimulationService"/>
<service>
<provide
interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
</scr:component>
@@ -0,0 +1,7 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
fragment.e4xmi,\
plugin.xml
source.. = src/
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_j3gbQL3xEeaUjdACK9cfYQ">
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_kYm9ML3xEeaUjdACK9cfYQ" featurename="commands" parentElementId="afryca.rcp.application">
<elements xsi:type="commands:Command" xmi:id="_n8IHQL3xEeaUjdACK9cfYQ" elementId="afryca.simulation.command.simulate" commandName="%afryca.simulation.command.simulate.name" description="%afryca.simulation.command.simulate.description"/>
<elements xsi:type="commands:Command" xmi:id="_0YH8kNcZEea9iaMsQHcLzQ" elementId="afryca.simulation.command.deselect_expert" commandName="%afryca.simulation.command.deselect_expert.name" description="%afryca.simulation.command.deselect_expert.description"/>
<elements xsi:type="commands:Command" xmi:id="_38pzQNcZEea9iaMsQHcLzQ" elementId="afryca.simulation.command.deselect_alternative" commandName="%afryca.simulation.command.deselect_alternative.name" description="%afryca.simulation.command.deselect_alternative.description"/>
<elements xsi:type="commands:Command" xmi:id="_r51LgO_lEee4_eMuDIy7BQ" elementId="afryca.simulation.command.deselect_criterion" commandName="%afryca.simulation.command.deselect_criterion.name" description="%afryca.simulation.command.deselect_criterion.description"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_mPg0cL3xEeaUjdACK9cfYQ" featurename="handlers" parentElementId="afryca.rcp.application">
<elements xsi:type="commands:Handler" xmi:id="_r7FQIL3xEeaUjdACK9cfYQ" elementId="afryca.simulation.handler.simulate" contributionURI="bundleclass://afryca.simulation/afryca.simulation.command.Simulate" command="_n8IHQL3xEeaUjdACK9cfYQ"/>
<elements xsi:type="commands:Handler" xmi:id="_6ltgMNcZEea9iaMsQHcLzQ" elementId="afryca.simulation.handler.deselect_expert" contributionURI="bundleclass://afryca.simulation/afryca.simulation.command.DeselectExpert" command="_0YH8kNcZEea9iaMsQHcLzQ"/>
<elements xsi:type="commands:Handler" xmi:id="_9FofQNcZEea9iaMsQHcLzQ" elementId="afryca.simulation.handler.deselect_alternative" contributionURI="bundleclass://afryca.simulation/afryca.simulation.command.DeselectAlternative" command="_38pzQNcZEea9iaMsQHcLzQ"/>
<elements xsi:type="commands:Handler" xmi:id="_6y3cUO_lEee4_eMuDIy7BQ" elementId="afryca.simulation.handler.deselect_criterion" contributionURI="bundleclass://afryca.simulation/afryca.simulation.command.DeselectCriterion" command="_r51LgO_lEee4_eMuDIy7BQ"/>
</fragments>
</fragment:ModelFragments>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<extension
id="afryca.simulation.fragment"
point="org.eclipse.e4.workbench.model">
<fragment
uri="fragment.e4xmi">
</fragment>
</extension>
</plugin>
@@ -0,0 +1,149 @@
package afryca.simulation;
import java.util.Map;
import afryca.behavior.Attitude;
import afryca.consensusmodel.Configuration;
import afryca.consensusmodel.definition.EResultElements;
import afryca.gdmp.GDMP;
/**
* Simulation
*
* @author Sinbad²
* @version 3.0
*/
public class Simulation {
public static final String INITIAL_ROUND = "SIMULATION_INITIAL_ROUND"; //$NON-NLS-1$
public static final String FINAL_ROUND = "SIMULATION_FINAL_ROUND"; //$NON-NLS-1$
public static final String SELECTED_EXPERT = "SIMULATION_SELECTED_EXPERT"; //$NON-NLS-1$
public static final String SELECTED_ALTERNATIVE = "SIMULATION_SELECTED_ALTERNATIVE"; //$NON-NLS-1$
public static final String SELECTED_CRITERION = "SIMULATION_SELECTED_CRITERION"; //$NON-NLS-1$
private GDMP gdmp;
private String consensusModelId;
private Configuration configuration;
private String behaviorId;
private Attitude attitude;
private Long timeStamp;
private Map<EResultElements, Object> result;
private Simulation() {
super();
}
/**
* Build a simulation
*
* @param gdmp
* @param consensusModelId
* @param configuration
* @param behaviorId
* @param attitude
* @param result
*/
public Simulation(GDMP gdmp, String consensusModelId, Configuration configuration, String behaviorId,
Attitude attitude, Map<EResultElements, Object> result) {
this();
setGDMP(gdmp);
setConsensusModelId(consensusModelId);
setConfiguration(configuration);
setBehaviorId(behaviorId);
setAttitude(attitude);
setResult(result);
setTimeStamp(System.currentTimeMillis());
}
private void setGDMP(GDMP gdmp) {
this.gdmp = gdmp;
}
private void setConsensusModelId(String consensusModelId) {
this.consensusModelId = consensusModelId;
}
private void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
private void setBehaviorId(String behaviorId) {
this.behaviorId = behaviorId;
}
private void setAttitude(Attitude attitude) {
this.attitude = attitude;
}
private void setResult(Map<EResultElements, Object> result) {
this.result = result;
}
private void setTimeStamp(Long timeStamp) {
this.timeStamp = timeStamp;
}
/**
* Return simulation GDMP
*
* @return GDMP
*/
public GDMP getGDMP() {
return gdmp;
}
/**
* Return simulation consensus model id
*
* @return Simulation consensus model id
*/
public String getConsensusModelId() {
return consensusModelId;
}
/**
* Return simulation configuration
*
* @return Simulation configuration
*/
public Configuration getConfiguration() {
return configuration;
}
/**
* Return simulation behavior id
*
* @return Simulation behavior id
*/
public String getBehaviorId() {
return behaviorId;
}
/**
* Return simulation attitude
*
* @return Simulation attitude
*/
public Attitude getAttitude() {
return attitude;
}
/**
* Return simulation result
*
* @return Simulation result
*/
public Map<EResultElements, Object> getResult() {
return result;
}
/**
* Return simulation time stamp
*
* @return Simulation time stamp
*/
public Long getTimeStamp() {
return timeStamp;
}
}
@@ -0,0 +1,29 @@
package afryca.simulation.command;
import afryca.simulation.service.ISimulationService;
/**
* Command for deselect alternative from GDMP simulation
*
* @author Sinbad²
* @version 3.0
*/
public class DeselectAlternative extends DeselectElement {
public static final String ID = "afryca.simulation.command.deselect_alternative"; //$NON-NLS-1$
@Override
String getID() {
return ID;
}
@Override
void deselect(ISimulationService simulationService) {
simulationService.setSelectedAlternative(null);
}
@Override
String getSelection(ISimulationService simulationService) {
return simulationService.getSelectedAlternative();
}
}
@@ -0,0 +1,29 @@
package afryca.simulation.command;
import afryca.simulation.service.ISimulationService;
/**
* Command for deselect expert from GDMP simulation
*
* @author Sinbad²
* @version 3.0
*/
public class DeselectCriterion extends DeselectElement {
public static final String ID = "afryca.simulation.command.deselect_criterion"; //$NON-NLS-1$
@Override
String getID() {
return ID;
}
@Override
void deselect(ISimulationService simulationService) {
simulationService.setSelectedCriterion(null);
}
@Override
String getSelection(ISimulationService simulationService) {
return simulationService.getSelectedCriterion();
}
}
@@ -0,0 +1,65 @@
package afryca.simulation.command;
import javax.inject.Inject;
import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.services.log.ILoggerProvider;
import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.e4.core.services.nls.Translation;
import afryca.simulation.l10n.Messages;
import afryca.simulation.service.ISimulationService;
/**
* Command for deselect element from simulation GDMP
*
* @author Sinbad²
* @version 3.0
*/
@SuppressWarnings("restriction")
public abstract class DeselectElement {
private Logger logger;
private Boolean lastCheckCanExecute;
@Inject
@Translation
private Messages messages;
@Inject
public void instantiateLogger(ILoggerProvider loggerProvider) {
logger = loggerProvider.getClassLogger(this.getClass());
}
@Execute
public void execute(ISimulationService simulationService) {
logger.info(messages.command_executed, getID());
deselect(simulationService);
}
abstract String getID();
abstract void deselect(ISimulationService simulationService);
@CanExecute
public boolean canExecute(ISimulationService simulationService) {
boolean can = checkCanCondition(simulationService);
tryToLogCanExecute(can);
return can;
}
private boolean checkCanCondition(ISimulationService simulationService) {
return (simulationService.getSelection() != null) && (getSelection(simulationService) != null);
}
abstract String getSelection(ISimulationService simulationService);
private void tryToLogCanExecute(boolean can) {
boolean log = (lastCheckCanExecute != null) ? (lastCheckCanExecute != can) : true;
lastCheckCanExecute = can;
if (log) {
logger.info(messages.command_can_executed_result, getID(), can);
}
}
}
@@ -0,0 +1,29 @@
package afryca.simulation.command;
import afryca.simulation.service.ISimulationService;
/**
* Command for deselect expert from GDMP simulation
*
* @author Sinbad²
* @version 3.0
*/
public class DeselectExpert extends DeselectElement {
public static final String ID = "afryca.simulation.command.deselect_expert"; //$NON-NLS-1$
@Override
String getID() {
return ID;
}
@Override
void deselect(ISimulationService simulationService) {
simulationService.setSelectedExpert(null);
}
@Override
String getSelection(ISimulationService simulationService) {
return simulationService.getSelectedExpert();
}
}
@@ -0,0 +1,60 @@
package afryca.simulation.command;
import javax.inject.Inject;
import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.services.log.ILoggerProvider;
import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.e4.core.services.nls.Translation;
import afryca.simulation.Simulation;
import afryca.simulation.l10n.Messages;
import afryca.simulation.service.ISimulationService;
/**
* Execute simulation
*
* @author Sinbad²
* @version 3.0
*/
@SuppressWarnings("restriction")
public class Simulate {
public static final String ID = "afryca.simulation.command.simulate"; //$NON-NLS-1$
private Logger logger;
private Boolean lastCheckCanExecute;
@Inject
@Translation
Messages messages;
@Inject
public void instantiateLogger(ILoggerProvider loggerProvider) {
logger = loggerProvider.getClassLogger(this.getClass());
}
@Execute
public Simulation execute(ISimulationService simulationService) {
logger.info(messages.command_executed, ID);
return simulationService.execute();
}
@CanExecute
public boolean canExecute(ISimulationService simulationService) {
boolean can = simulationService.canExecute();
tryToLogCanExecute(can);
return can;
}
private void tryToLogCanExecute(boolean can) {
boolean log = (lastCheckCanExecute != null) ? (lastCheckCanExecute != can) : true;
lastCheckCanExecute = can;
if (log) {
logger.info(messages.command_can_executed_result, ID, can);
}
}
}
@@ -0,0 +1,19 @@
package afryca.simulation.l10n;
/**
* Localization messages
*
* @author Sinbad²
* @version 3.0
*/
public class Messages {
public String alternative_selected_x;
public String command_can_executed_result;
public String command_executed;
public String criterion_selected_x;
public String expert_selected_x;
public String final_round_selected_x;
public String initial_round_selected_x;
public String simulation_added_x;
public String simulation_selected_x;
}
@@ -0,0 +1,9 @@
alternative_selected_x=Alternative selected {0}
command_can_executed_result={0} can be executed? {1}
command_executed={0} executed
criterion_selected_x=Criterion selected {0}
expert_selected_x=Expert selected {0}
final_round_selected_x=Final round selected {0}
initial_round_selected_x=Initial round selected {0}
simulation_added_x=Simulation added {0}
simulation_selected_x=Simulation selected {0}
@@ -0,0 +1,9 @@
alternative_selected_x=Alternativa seleccionada {0}
command_can_executed_result=¿{0} puede ser ejecutado? {1}
command_executed={0} ejecutado
criterion_selected_x=Criterio seleccionado {0}
expert_selected_x=Experto seleccionado {0}
final_round_selected_x=Ronda final seleccionada {0}
initial_round_selected_x=Ronda inicial seleccionada {0}
simulation_added_x=Simulación añadida {0}
simulation_selected_x=Simulación seleccionada {0}
@@ -0,0 +1,132 @@
package afryca.simulation.service;
import java.util.Map;
import afryca.simulation.Simulation;
/**
* Simulation service
*
* @author Sinbad²
* @version 3.0
*/
public interface ISimulationService {
/**
* Current simulation can be executed
*
* @return True if simulation can be executed, False in other case
*/
boolean canExecute();
/**
* Current configuration meets requirements
*
* @return True if configuration meets requirements. False in other case
*/
boolean configurationMeetsRequirements();
/**
* Perform simulation
*
* @return Simulation results. Null if canExecute() is false
*/
Simulation execute();
/**
* Return simulation stack
*
* @return Execution stack
*/
Map<Long, Simulation> getSimulationStack();
/**
* Set selected simulation
*
* @param simulation
* Selected simulation
*/
void setSelection(Simulation simulation);
/**
* Get selected simulation
*
* @return Selected simulation
*/
Simulation getSelection();
/**
* Set initial round
*
* @param round
* Initial round
*/
void setInitialRound(Integer round);
/**
* Get initial round
*
* @return Initial round
*/
Integer getInitialRound();
/**
* Set final round
*
* @param round
* Final round
*/
void setFinalRound(Integer round);
/**
* Get final round
*
* @return Final round
*/
Integer getFinalRound();
/**
* Set selected expert
*
* @param expert
* Selected expert
*/
void setSelectedExpert(String expert);
/**
* Get selected expert
*
* @return Selected expert
*/
String getSelectedExpert();
/**
* Set selected alternative
*
* @param alternative
* Selected alternative
*/
void setSelectedAlternative(String alternative);
/**
* Get selected alternative
*
* @return Selected alternative
*/
String getSelectedAlternative();
/**
* Set selected criterion
*
* @param criterion
* Selected criterion
*/
void setSelectedCriterion(String criterion);
/**
* Get selected criterion
*
* @return Selected criterion
*/
String getSelectedCriterion();
}
@@ -0,0 +1,32 @@
package afryca.simulation.service.events;
import afryca.simulation.Simulation;
/**
* ISimulationService events
*
* @author Sinbad²
* @version 3.0
*
* @noimplement Only used for constant definition
*/
public interface ISimulationServiceEvents {
String TOPIC_BASE = "SIMULATIONS"; //$NON-NLS-1$
String SIMULATION_GROUP_UPDATES = TOPIC_BASE + "/GROUP_UPDATES"; //$NON-NLS-1$
String SIMULATION_ALL = TOPIC_BASE + "/*"; //$NON-NLS-1$
String SIMULATION_ADDED = TOPIC_BASE + "/ADDED"; //$NON-NLS-1$
String SIMULATION_SELECTION_UPDATED = TOPIC_BASE + "/SELECTION"; //$NON-NLS-1$
String SIMULATION_INITIAL_ROUND_UPDATED = TOPIC_BASE + "/" + Simulation.INITIAL_ROUND;
String SIMULATION_FINAL_ROUND_UPDATED = TOPIC_BASE + "/" + Simulation.FINAL_ROUND;
String SIMULATION_SELECTED_EXPERT_UPDATED = TOPIC_BASE + "/" + Simulation.SELECTED_EXPERT;
String SIMULATION_SELECTED_ALTERNATIVE_UPDATED = TOPIC_BASE + "/" + Simulation.SELECTED_ALTERNATIVE;
String SIMULATION_SELECTED_CRITERION_UPDATED = TOPIC_BASE + "/" + Simulation.SELECTED_CRITERION;
String FIELD_TIME_STAMP = "timeStamp"; //$NON-NLS-1$
String FIELD_INITIAL_ROUND = Simulation.INITIAL_ROUND;
String FIELD_FINAL_ROUND = Simulation.FINAL_ROUND;
String FIELD_SELECTED_EXPERT = Simulation.SELECTED_EXPERT;
String FIELD_SELECTED_ALTERNATIVE = Simulation.SELECTED_ALTERNATIVE;
String FIELD_SELECTED_CRITERION = Simulation.SELECTED_CRITERION;
String FIELD_GROUPED = "grouped"; //$NON-NLS-1$
}
@@ -0,0 +1,25 @@
package afryca.simulation.service.provider;
import org.eclipse.e4.core.contexts.ContextFunction;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.model.application.MApplication;
import afryca.simulation.service.ISimulationService;
/**
* Simulation service context function
*
* @author Sinbad²
* @version 3.0
*/
public class SimulationServiceContextFunction extends ContextFunction {
@Override
public Object compute(IEclipseContext context, String contextKey) {
ISimulationService simulationService = ContextInjectionFactory.make(SimulationServiceProvider.class, context);
MApplication application = context.get(MApplication.class);
IEclipseContext applicationContext = application.getContext();
applicationContext.set(ISimulationService.class, simulationService);
return simulationService;
}
}
@@ -0,0 +1,678 @@
package afryca.simulation.service.provider;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.di.extensions.EventTopic;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.e4.core.services.log.ILoggerProvider;
import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.e4.core.services.nls.Translation;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.workbench.UIEvents;
import afryca.ase.service.IASEService;
import afryca.behavior.Attitude;
import afryca.behavior.service.IBehaviorService;
import afryca.behavior.service.events.IBehaviorServiceEvents;
import afryca.consensusmodel.Configuration;
import afryca.consensusmodel.ConsensusModel;
import afryca.consensusmodel.Variables;
import afryca.consensusmodel.definition.ConsensusModelRegistry;
import afryca.consensusmodel.definition.EResultElements;
import afryca.consensusmodel.provider.IConsensusModelProvider;
import afryca.consensusmodel.provider.IVariablesProvider;
import afryca.consensusmodel.service.IConsensusModelService;
import afryca.consensusmodel.service.events.IConsensusModelServiceEvents;
import afryca.consensusmodel.variable.Variable;
import afryca.consensusmodel.variable.array_relation.ArrayRelation;
import afryca.consensusmodel.variable.array_restriction.ArrayRestriction;
import afryca.consensusmodel.variable.definition.EVariableTypes;
import afryca.consensusmodel.variable.relation.Relation;
import afryca.consensusmodel.variable.restriction.Restriction;
import afryca.gdmp.GDMP;
import afryca.gdmp.service.IGDMPService;
import afryca.gdmp.service.events.IGDMPServiceEvents;
import afryca.simulation.Simulation;
import afryca.simulation.l10n.Messages;
import afryca.simulation.service.ISimulationService;
import afryca.simulation.service.events.ISimulationServiceEvents;
import afryca.structure.Structure;
/**
* Simulation service provider
*
* @author Sinbad²
* @version 3.0
*/
@SuppressWarnings("restriction")
public class SimulationServiceProvider implements ISimulationService {
private Logger logger;
private Map<Long, Simulation> simulations;
private boolean groupUpdates;
private boolean needEnablementUpdate;
private boolean computeCanExecute;
private boolean lastCanExecute;
@Inject
private IGDMPService gdmpService;
@Inject
private IConsensusModelService consensusModelService;
@Inject
private IBehaviorService behaviorService;
@Inject
private IVariablesProvider variablesProvider;
@Inject
private IConsensusModelProvider consensusModelProvider;
@Inject
private IASEService aseService;
@Inject
private IEventBroker eventBroker;
@Inject
private IEclipseContext context;
@Inject
@Translation
private Messages messages;
private Configuration merge;
private ConsensusModel consensusModel;
@Inject
public void instantiateLogger(ILoggerProvider loggerProvider) {
logger = loggerProvider.getClassLogger(this.getClass());
}
@Inject
public SimulationServiceProvider() {
simulations = new HashMap<>();
groupUpdates = false;
needEnablementUpdate = false;
computeCanExecute = true;
lastCanExecute = false;
}
@Override
public boolean canExecute() {
if (computeCanExecute) {
boolean canExecute = false;
merge = null;
consensusModel = null;
if (configurationMeetsRequirements()) {
if (dependenciesAreMet()) {
consensusModel = consensusModelProvider.createConsensusModel(getSelectedConsensusModel());
canExecute = consensusModel.setConfiguration(merge);
}
}
lastCanExecute = canExecute;
computeCanExecute = false;
}
return lastCanExecute;
}
private boolean dependenciesAreMet() {
return (aConsensusModelIsSelected() && feedbackRequirementsAreMet() && configurationRequirementsAreMet() && getStructureSelectedEqualsModel());
}
private boolean aConsensusModelIsSelected() {
return (getSelectedConsensusModel() != null);
}
private String getSelectedConsensusModel() {
return consensusModelService.getSelection();
}
private boolean getStructureSelectedEqualsModel(){
GDMP gdmp = gdmpService.getSelection();
String idCM = consensusModelService.getSelection();
if(gdmp.getStructure().equals(consensusModelService.getSupportedStructure(idCM))) {
return true;
}
return false;
}
private boolean feedbackRequirementsAreMet() {
return (aConsensusModelWithFeedbackIsSelected(getSelectedConsensusModel())) ? (aBehaviorIsSelected()) : true;
}
private boolean aConsensusModelWithFeedbackIsSelected(String id) {
ConsensusModelRegistry registry = consensusModelService.getRegistry(id);
IConfigurationElement configuration = registry.getConfiguration();
String feedbackValue = configuration.getAttribute(ConsensusModel.WITH_FEEDBACK);
return Boolean.parseBoolean(feedbackValue);
}
private boolean aBehaviorIsSelected() {
return (getSelectedBehavior() != null);
}
private String getSelectedBehavior() {
return behaviorService.getSelection();
}
private boolean configurationRequirementsAreMet() {
return (aConfigurationIsSelected() && aValidGDMPIsSelected());
}
private boolean aConfigurationIsSelected() {
return (getSelectedConfiguration() != null);
}
private Configuration getSelectedConfiguration() {
return consensusModelService.getConfiguration();
}
private boolean aValidGDMPIsSelected() {
return aGDMPIsSelected() && notMissingValues();
}
private boolean aGDMPIsSelected() {
return (getSelectedGDMP() != null);
}
private GDMP getSelectedGDMP() {
return gdmpService.getSelection();
}
private boolean notMissingValues() {
GDMP gdmp = getSelectedGDMP();
Structure collective = gdmp.getPreference(0, 0).groupPreferences(gdmp.getExperts().size(), gdmp.getAlternatives().size(), gdmp.getCriteria().size(),
gdmp.getPreferences().toArray(new Structure[gdmp.getPreferences().size()]));
return !(boolean) aseService
.createFragmentBuilder()
.putVariable("collective", collective)
.putVariable("row", ((Object[][]) collective.getPreferences()).length)
.putVariable("col", ((Object[][]) collective.getPreferences())[0].length)
.addLine("consistency.containsMissingValues(collective, row, col)") //$NON-NLS-1$
.setOutputType(Boolean.class.getName())
.eval()
.getResult();
}
@Override
public boolean configurationMeetsRequirements() {
merge = mergeConfiguration(getSelectedConfiguration(), getSelectedGDMP());
return configurationMeetsRequirements(merge);
}
private static Configuration mergeConfiguration(Configuration configuration, GDMP gdmp) {
Configuration result = null;
if (configuration != null) {
if (gdmp != null) {
result = configuration.copy();
result.setValue(GDMP.FIELD_FILE, gdmp.getFile());
result.setValue(GDMP.FIELD_EXPERTS, gdmp.getExperts().toArray(new String[0]));
result.setValue(GDMP.FIELD_ALTERNATIVES, gdmp.getAlternatives().toArray(new String[0]));
result.setValue(GDMP.FIELD_CRITERIA, gdmp.getCriteria().toArray(new String[0]));
result.setValue(GDMP.FIELD_PREFERENCES, gdmp.getPreferences().toArray(new Structure[0]));
result = result.copy();
}
}
return result;
}
private boolean configurationMeetsRequirements(Configuration configuration) {
if (configuration != null) {
Variables variables = variablesProvider.getVariables(getSelectedConsensusModel());
for (Variable variable : variables.getVariables().values()) {
if (!variable.getIsInternal()) {
if (configuration.getValue(variable.getId()) == null) {
if(!variable.getType().equals(EVariableTypes.Dialog)) {
return false;
}
}
if (variable.getIsArray()) {
if (!validateArrayVariable(configuration, variables, variable)) {
return false;
}
} else {
if (!validateVariable(configuration, variables, variable)) {
return false;
}
}
}
}
return true;
}
return false;
}
private boolean validateArrayVariable(Configuration configuration, Variables variables, Variable variable) {
try {
for (ArrayRelation arrayRelation : variable.getArrayRelations().getArrayRelations()) {
if (!arrayRelation.check(configuration.getValue(variable.getId()),
configuration.getValue(arrayRelation.getVariableId()))) {
return false;
}
}
for (ArrayRestriction arrayRestriction : variable.getArrayRestrictions().getArrayRestrictions()) {
if (!arrayRestriction.check(configuration.getValue(variable.getId()))) {
return false;
}
}
return true;
} catch (Exception e) {
return false;
}
}
private boolean validateVariable(Configuration configuration, Variables variables, Variable variable) {
try {
for (Relation relation : variable.getRelations().getRelations()) {
if (!relation.check(configuration.getValue(variable.getId()), configuration.getValue(relation.getVariableId()))) {
return false;
}
}
for (Restriction restriction : variable.getRestrictions().getRestrictions()) {
if (!restriction.check(configuration.getValue(variable.getId()))) {
return false;
}
}
return true;
} catch (Exception e) {
return false;
}
}
@Override
public Simulation execute() {
Simulation simulation = null;
Map<EResultElements, Object> result = getResults();
if (result != null) {
computeCanExecute = true;
simulation = new Simulation(
getSelectedGDMP().copy(),
getSelectedConsensusModel(),
getSelectedConfiguration().copy(),
getSelectedBehavior(),
getSelectedAttitude()==null?null:getSelectedAttitude().copy(),
result);
simulations.put(simulation.getTimeStamp(), simulation);
logger.info(messages.simulation_added_x, simulation.getTimeStamp());
final Simulation stepSimulation = simulation;
doGroupUpdateStep(() -> {
eventBroker.send(ISimulationServiceEvents.SIMULATION_ADDED, new HashMap<String, String>());
setSelection(stepSimulation);
consensusModel = null;
needEnablementUpdate = true;
});
}
return simulation;
}
private Map<EResultElements, Object> getResults() {
return (consensusModel != null) || ((consensusModel == null) && canExecute())
? consensusModel.execute()
: null;
}
private Attitude getSelectedAttitude() {
return behaviorService.getAttitude();
}
@Override
public Map<Long, Simulation> getSimulationStack() {
return simulations;
}
private void doGroupUpdateStep(Runnable step) {
if (groupUpdates) {
step.run();
} else {
groupUpdatesActive(true);
step.run();
groupUpdatesActive(false);
}
}
private void groupUpdatesActive(boolean active) {
if (groupUpdates != active) {
groupUpdates = active;
eventBroker.send(
ISimulationServiceEvents.SIMULATION_GROUP_UPDATES,
createEventData(
ISimulationServiceEvents.SIMULATION_GROUP_UPDATES,
ISimulationServiceEvents.FIELD_GROUPED,
Boolean.toString(groupUpdates)));
updateEnablement();
}
}
@Override
public void setSelection(Simulation selection) {
if (isNewSelection(selection)) {
doGroupUpdateStep(() -> {
cleanSimulationRelatedElements();
String time = (selection != null) ? selection.getTimeStamp().toString() : null;
logger.info(messages.simulation_selected_x, time);
getApplicationContext().set(Simulation.class, selection);
Map<String, String> event = createEventData(
ISimulationServiceEvents.SIMULATION_SELECTION_UPDATED,
ISimulationServiceEvents.FIELD_TIME_STAMP,
time);
eventBroker.send(ISimulationServiceEvents.SIMULATION_SELECTION_UPDATED, event);
initializeRoundsSelection();
needEnablementUpdate = true;
});
}
}
private boolean isNewSelection(Simulation newSelection) {
Simulation oldSelection = getSelection();
if ((oldSelection == null) && (newSelection == null)) {
return false;
}
if ((oldSelection == null) || (newSelection == null)) {
return true;
}
return newSelection.getTimeStamp().longValue() != oldSelection.getTimeStamp().longValue();
}
private IEclipseContext getApplicationContext() {
MApplication application = context.get(MApplication.class);
return application.getContext();
}
private void cleanSimulationRelatedElements() {
setInitialRound(null);
setFinalRound(null);
setSelectedExpert(null);
setSelectedAlternative(null);
}
private Map<String, String> createEventData(String topic, String field, String value) {
Map<String, String> map = new HashMap<>();
map.put(ISimulationServiceEvents.TOPIC_BASE, topic);
map.put(field, value);
return map;
}
private void updateEnablement() {
if (!groupUpdates && needEnablementUpdate) {
eventBroker.send(UIEvents.REQUEST_ENABLEMENT_UPDATE_TOPIC, UIEvents.ALL_ELEMENT_ID);
needEnablementUpdate = false;
}
}
private void initializeRoundsSelection() {
if (getSelection() != null) {
setInitialRound(0);
setFinalRound(getNumberOfRounds() - 1);
}
}
@Override
public Simulation getSelection() {
return getApplicationContext().get(Simulation.class);
}
private int getNumberOfRounds() {
Simulation simulation = getSelection();
return (simulation == null)
? 0
: ((List<?>) simulation.getResult().get(EResultElements.rounds_results)).size();
}
@Override
public void setInitialRound(Integer round) {
if (isDifferentSelection(getInitialRound(), round)) {
if (isValidRound(round)) {
doGroupUpdateStep(() -> {
adaptFinalRoundToNewInitialRound(round);
logger.info(messages.initial_round_selected_x, round);
getApplicationContext().set(Simulation.INITIAL_ROUND, round);
eventBroker.send(
ISimulationServiceEvents.SIMULATION_INITIAL_ROUND_UPDATED,
createEventData(
ISimulationServiceEvents.SIMULATION_INITIAL_ROUND_UPDATED,
ISimulationServiceEvents.FIELD_INITIAL_ROUND,
(round != null) ? round.toString() : null));
needEnablementUpdate = true;
});
}
}
}
private boolean isDifferentSelection(Integer oldSelection, Integer newSelection) {
if ((oldSelection == null) && (newSelection == null)) {
return false;
}
if ((oldSelection == null) || (newSelection == null)) {
return true;
}
return newSelection.intValue() != oldSelection.intValue();
}
private boolean isValidRound(Integer round) {
return (round == null)
? true // For cleaning
: (round >= 0) && (round < getNumberOfRounds());
}
private void adaptFinalRoundToNewInitialRound(Integer initialRound) {
if (initialRound != null) {
Integer finalRound = getFinalRound();
if ((finalRound != null) && (finalRound < initialRound)) {
setFinalRound(Integer.valueOf(initialRound.intValue()));
}
}
}
@Override
public Integer getInitialRound() {
return (Integer) getApplicationContext().get(Simulation.INITIAL_ROUND);
}
@Override
public void setFinalRound(Integer round) {
if (isDifferentSelection(getFinalRound(), round)) {
if (isValidRound(round)) {
doGroupUpdateStep(() -> {
adaptInitialRoundToNewFinalRound(round);
logger.info(messages.final_round_selected_x, round);
getApplicationContext().set(Simulation.FINAL_ROUND, round);
eventBroker.send(ISimulationServiceEvents.SIMULATION_FINAL_ROUND_UPDATED,
createEventData(ISimulationServiceEvents.SIMULATION_FINAL_ROUND_UPDATED,
ISimulationServiceEvents.FIELD_FINAL_ROUND,
(round != null) ? round.toString() : null));
updateEnablement();
needEnablementUpdate = true;
});
}
}
}
@Override
public Integer getFinalRound() {
return (Integer) getApplicationContext().get(Simulation.FINAL_ROUND);
}
private void adaptInitialRoundToNewFinalRound(Integer finalRound) {
if (finalRound != null) {
Integer initialRound = getInitialRound();
if ((initialRound != null) && (initialRound > finalRound)) {
setInitialRound(Integer.valueOf(finalRound.intValue()));
}
}
}
@Override
public void setSelectedExpert(String expert) {
if (isNewExpertSelection(expert)) {
logger.info(messages.expert_selected_x, expert);
getApplicationContext().set(Simulation.SELECTED_EXPERT, expert);
doGroupUpdateStep(() -> {
eventBroker.post(ISimulationServiceEvents.SIMULATION_SELECTED_EXPERT_UPDATED,
createEventData(ISimulationServiceEvents.SIMULATION_SELECTED_EXPERT_UPDATED,
ISimulationServiceEvents.FIELD_SELECTED_EXPERT, expert));
needEnablementUpdate = true;
});
}
}
private boolean isNewExpertSelection(String newSelection) {
String oldSelection = getSelectedExpert();
if ((oldSelection == null) && (newSelection == null)) {
return false;
}
if ((oldSelection == null) || (newSelection == null)) {
return true;
}
return (!oldSelection.equals(newSelection));
}
@Override
public String getSelectedExpert() {
return (String) getApplicationContext().get(Simulation.SELECTED_EXPERT);
}
@Override
public void setSelectedAlternative(String alternative) {
if (isNewAlternativeSelection(alternative)) {
logger.info(messages.alternative_selected_x, alternative);
getApplicationContext().set(Simulation.SELECTED_ALTERNATIVE, alternative);
doGroupUpdateStep(() -> {
eventBroker.post(ISimulationServiceEvents.SIMULATION_SELECTED_ALTERNATIVE_UPDATED,
createEventData(ISimulationServiceEvents.SIMULATION_SELECTED_ALTERNATIVE_UPDATED,
ISimulationServiceEvents.FIELD_SELECTED_ALTERNATIVE, alternative));
needEnablementUpdate = true;
});
}
}
private boolean isNewAlternativeSelection(String newSelection) {
String oldSelection = getSelectedAlternative();
if ((oldSelection == null) && (newSelection == null)) {
return false;
}
if ((oldSelection == null) || (newSelection == null)) {
return true;
}
return (!oldSelection.equals(newSelection));
}
@Override
public String getSelectedAlternative() {
return (String) getApplicationContext().get(Simulation.SELECTED_ALTERNATIVE);
}
@Override
public void setSelectedCriterion(String criterion) {
if (isNewCriterionSelection(criterion)) {
logger.info(messages.criterion_selected_x, criterion);
getApplicationContext().set(Simulation.SELECTED_CRITERION, criterion);
doGroupUpdateStep(() -> {
eventBroker.post(ISimulationServiceEvents.SIMULATION_SELECTED_CRITERION_UPDATED,
createEventData(ISimulationServiceEvents.SIMULATION_SELECTED_CRITERION_UPDATED,
ISimulationServiceEvents.FIELD_SELECTED_CRITERION, criterion));
needEnablementUpdate = true;
});
}
}
private boolean isNewCriterionSelection(String newSelection) {
String oldSelection = getSelectedCriterion();
if ((oldSelection == null) && (newSelection == null)) {
return false;
}
if ((oldSelection == null) || (newSelection == null)) {
return true;
}
return (!oldSelection.equals(newSelection));
}
@Override
public String getSelectedCriterion() {
return (String) getApplicationContext().get(Simulation.SELECTED_CRITERION);
}
@Inject
@Optional
private void subscribeTopicGDMP(
@EventTopic(IGDMPServiceEvents.GDMP_ALL) Map<String, String> event) {
updateComputeCanExecuteValue(
event,
IGDMPServiceEvents.TOPIC_BASE,
IGDMPServiceEvents.GDMP_GROUP_UPDATES,
IGDMPServiceEvents.FIELD_GROUPED,
new String[] {
IGDMPServiceEvents.GDMP_EXPERTS_SELECTION_UPDATED,
IGDMPServiceEvents.GDMP_ALTERNATIVES_SELECTION_UPDATED,
IGDMPServiceEvents.GDMP_CRITERIA_SELECTION_UPDATED
});
}
private void updateComputeCanExecuteValue(Map<String, String> event, String topicBase, String topicGroup,
String fieldGrouped, String[] exclusions) {
computeCanExecute = (event.get(topicBase).equals(topicGroup))
? !Boolean.parseBoolean((String) event.get(fieldGrouped))
: excluded(exclusions, event)
? computeCanExecute
: true;
}
private boolean excluded(String[] excludedTopics, Map<String, String> event) {
if ((excludedTopics == null) || (event == null)) {
return false;
}
for (String excludedTopic : excludedTopics) {
if (event.containsKey(excludedTopic)) {
return true;
}
}
return false;
}
@Inject
@Optional
private void subscribeTopicConsensusModel(
@EventTopic(IConsensusModelServiceEvents.CONSENSUS_MODELS_ALL) Map<String, String> event) {
updateComputeCanExecuteValue(
event,
IConsensusModelServiceEvents.TOPIC_BASE,
IConsensusModelServiceEvents.CONSENSUS_MODEL_GROUP_UPDATES,
IConsensusModelServiceEvents.FIELD_GROUPED,
null);
}
@Inject
@Optional
private void subscribeTopicBehavior(
@EventTopic(IBehaviorServiceEvents.BEHAVIORS_ALL) Map<String, String> event) {
updateComputeCanExecuteValue(
event,
IBehaviorServiceEvents.TOPIC_BASE,
IBehaviorServiceEvents.BEHAVIOR_GROUP_UPDATES,
IBehaviorServiceEvents.FIELD_GROUPED,
null);
}
}
@@ -0,0 +1,18 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: afryca.simulation;singleton:=true
Bundle-Version: 1.0.0.202101221157
Bundle-Vendor: %Bundle-Vendor
Export-Package: afryca.simulation,afryca.simulation.command,afryca.simul
ation.service,afryca.simulation.service.events
Require-Bundle: afryca.ase,afryca.gdmp;visibility:=reexport,afryca.behav
ior;visibility:=reexport,afryca.consensusmodel;visibility:=reexport,org
.eclipse.core.runtime,org.eclipse.e4.core.di,org.eclipse.e4.core.di.ext
ensions,org.eclipse.e4.core.contexts,org.eclipse.e4.core.services,org.e
clipse.e4.ui.workbench,org.eclipse.e4.ui.model.workbench
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Service-Component: OSGI-INF/simulation_service_context_function.xml
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: afryca.simulation
@@ -0,0 +1,9 @@
alternative_selected_x=Alternative selected {0}
command_can_executed_result={0} can be executed? {1}
command_executed={0} executed
criterion_selected_x=Criterion selected {0}
expert_selected_x=Expert selected {0}
final_round_selected_x=Final round selected {0}
initial_round_selected_x=Initial round selected {0}
simulation_added_x=Simulation added {0}
simulation_selected_x=Simulation selected {0}
@@ -0,0 +1,9 @@
alternative_selected_x=Alternativa seleccionada {0}
command_can_executed_result=¿{0} puede ser ejecutado? {1}
command_executed={0} ejecutado
criterion_selected_x=Criterio seleccionado {0}
expert_selected_x=Experto seleccionado {0}
final_round_selected_x=Ronda final seleccionada {0}
initial_round_selected_x=Ronda inicial seleccionada {0}
simulation_added_x=Simulación añadida {0}
simulation_selected_x=Simulación seleccionada {0}
@@ -0,0 +1,4 @@
#Fri Jan 22 13:02:30 CET 2021
artifact.main=C\:\\Users\\\u00C1lvaro\\Workspaces\\afryca_2020\\afryca\\plugins\\afryca.simulation\\target\\afryca.simulation-1.0.0-SNAPSHOT.jar
artifact.attached.p2artifacts=C\:\\Users\\\u00C1lvaro\\Workspaces\\afryca_2020\\afryca\\plugins\\afryca.simulation\\target\\p2artifacts.xml
artifact.attached.p2metadata=C\:\\Users\\\u00C1lvaro\\Workspaces\\afryca_2020\\afryca\\plugins\\afryca.simulation\\target\\p2content.xml
@@ -0,0 +1,3 @@
artifactId=afryca.simulation
groupId=afryca.group
version=1.0.0-SNAPSHOT
@@ -0,0 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<?artifactRepository version='1.1.0'?>
<artifacts size='1'>
<artifact classifier='osgi.bundle' id='afryca.simulation' version='1.0.0.202101221157'>
<properties size='5'>
<property name='artifact.size' value='23701'/>
<property name='download.size' value='23701'/>
<property name='maven-groupId' value='afryca.group'/>
<property name='maven-artifactId' value='afryca.simulation'/>
<property name='maven-version' value='1.0.0-SNAPSHOT'/>
</properties>
</artifact>
</artifacts>
@@ -0,0 +1,62 @@
<?xml version='1.0' encoding='UTF-8'?>
<units size='1'>
<unit id='afryca.simulation' version='1.0.0.202101221157' generation='2'>
<update id='afryca.simulation' range='[0.0.0,1.0.0.202101221157)' severity='0'/>
<properties size='9'>
<property name='es.Bundle-Name' value='Simulación'/>
<property name='es.Bundle-Vendor' value='Sinbad²'/>
<property name='df_LT.Bundle-Name' value='Simulation'/>
<property name='df_LT.Bundle-Vendor' value='Sinbad²'/>
<property name='org.eclipse.equinox.p2.name' value='%Bundle-Name'/>
<property name='org.eclipse.equinox.p2.provider' value='%Bundle-Vendor'/>
<property name='maven-groupId' value='afryca.group'/>
<property name='maven-artifactId' value='afryca.simulation'/>
<property name='maven-version' value='1.0.0-SNAPSHOT'/>
</properties>
<provides size='10'>
<provided namespace='org.eclipse.equinox.p2.iu' name='afryca.simulation' version='1.0.0.202101221157'/>
<provided namespace='osgi.bundle' name='afryca.simulation' version='1.0.0.202101221157'/>
<provided namespace='java.package' name='afryca.simulation' version='0.0.0'/>
<provided namespace='java.package' name='afryca.simulation.command' version='0.0.0'/>
<provided namespace='java.package' name='afryca.simulation.service' version='0.0.0'/>
<provided namespace='java.package' name='afryca.simulation.service.events' version='0.0.0'/>
<provided namespace='osgi.identity' name='afryca.simulation' version='1.0.0.202101221157'>
<properties size='1'>
<property name='type' value='osgi.bundle'/>
</properties>
</provided>
<provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
<provided namespace='org.eclipse.equinox.p2.localization' name='es' version='1.0.0'/>
<provided namespace='org.eclipse.equinox.p2.localization' name='df_LT' version='1.0.0'/>
</provides>
<requires size='12'>
<required namespace='osgi.bundle' name='afryca.ase' range='0.0.0'/>
<required namespace='osgi.bundle' name='afryca.gdmp' range='0.0.0'/>
<required namespace='osgi.bundle' name='afryca.behavior' range='0.0.0'/>
<required namespace='osgi.bundle' name='afryca.consensusmodel' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.core.runtime' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.e4.core.di' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.e4.core.di.extensions' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.e4.core.contexts' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.e4.core.services' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.e4.ui.workbench' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.e4.ui.model.workbench' range='0.0.0'/>
<requiredProperties namespace='osgi.ee' match='(&amp;(osgi.ee=JavaSE)(version=1.8))'>
<description>
afryca.simulation
</description>
</requiredProperties>
</requires>
<artifacts size='1'>
<artifact classifier='osgi.bundle' id='afryca.simulation' version='1.0.0.202101221157'/>
</artifacts>
<touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
<touchpointData size='1'>
<instructions size='1'>
<instruction key='manifest'>
Bundle-SymbolicName: afryca.simulation;singleton:=true&#xA;Bundle-Version: 1.0.0.202101221157&#xA;
</instruction>
</instructions>
</touchpointData>
</unit>
</units>