8000 Test code cleaning by hmiomand · Pull Request #383 · preesm/preesm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Test code cleaning #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 104 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
1bc056a
JEPCustomFunctionTest: replaced set of tests by Parameterized test
hmiomand Mar 11, 2024
2ba179c
JavaExpressionParserTest: Replaced set of externally generated tests …
hmiomand Mar 11, 2024
359b50a
PiGraphLookupTest: Separated tests
hmiomand Mar 11, 2024
e6b0df8
Moving test resources to fix failing CI
hmiomand Mar 11, 2024
8555d19
TopologyTest: Refacto to make use of assertThrows
hmiomand Mar 12, 2024
ec9b652
Removed code smell
hmiomand Mar 12, 2024
eebd651
Github Actions: updated actions to address upcoming node16 deprecation
hmiomand Mar 12, 2024
5003804
PiSDFSubgraphBuilderTest: small refacto
hmiomand Mar 12, 2024
59123aa
Merged and remove duplicate tests in GraphStructureHelper
hmiomand Mar 13, 2024
5b6430c
Renamed org.ietr.preesm.mathematicalModels.test package
hmiomand Mar 13, 2024
abebc57
Cleanup in org.ietr.preesm.schedule.test
hmiomand Mar 13, 2024
2b77619
Cleanup in TransformerTest
hmiomand Mar 13, 2024
3374110
Removed specific exception handling in JEPCustomFunctionTest
hmiomand Mar 13, 2024
b9967b8
Cleanup in deadlock tests
hmiomand Mar 13, 2024
f5e8cf6
Removed barely used and outdated JMathArray dependency for the alread…
hmiomand Mar 13, 2024
2f5161e
Code cleaning in org.preesm.algorithm.model.sdf
hmiomand Mar 13, 2024
a6730df
code cleaning in PiGraphFiringBalancerTest
hmiomand Mar 13, 2024
eaf8971
Fix unit test not failing
hmiomand Mar 13, 2024
f10cee7
Fixed matrix rank result
hmiomand Mar 13, 2024
3382081
Code cleaning in GraphStructureHelperTest
hmiomand Mar 14, 2024
798e8df
Fix typo in test name ReflectionUtilTest
hmiomand Mar 14, 2024
b40c62b
Updated dependencies and removed unused ones
hmiomand Mar 14, 2024
d4b0860
Updated JDK to 17.0.10
hmiomand Mar 14, 2024
e51aaf7
Updated dependencies in pom.xml
hmiomand Mar 15, 2024
2416b67
Removed a checkstyle rule that started to be applied after a checksty…
hmiomand Mar 15, 2024
47b1773
Removed code smell in org.preesm.algorithm.synthesis.schedule.algos
hmiomand Mar 19, 2024
93c551a
Enforce immutability in RefinementChecker accepted header file extens…
hmiomand Mar 19, 2024
4c08206
Modified regex in RefinementChecker.isHlsStreamTemplated and added te…
hmiomand Mar 19, 2024
2bc25e2
Code cleaning in XMLStatsExporter
hmiomand Mar 21, 2024
ab89740
Code cleaning in AbstractPiSDFObjectChecker
hmiomand Mar 21, 2024
452e80b
Code cleaning in MalleableParameterExprChecker, regex may need to be …
hmiomand Mar 21, 2024
ff4f01d
Code cleaning in PiParser
hmiomand Mar 21, 2024
da426bf
Code cleaning in PapifyPage
hmiomand Mar 21, 2024
684b47a
Change tests in RefinementCheckerTest to add some variation
hmiomand Mar 21, 2024
ddd0f42
Code cleaning in PiSDFSubgraphBuilderTest
hmiomand Mar 21, 2024
13ba29e
Re-added previously removed runtime libraries
hmiomand Mar 21, 2024
6d9e92c
Modified CI to cancel in-progress runs when starting a new one
hmiomand Mar 21, 2024
6c999e4
Added a basic test case to test choco scheduler with new synthesis.
hmiomand Mar 21, 2024
d6003a8
Update in target platform
hmiomand Mar 21, 2024
e052686
Code cleaning in ScenarioParser
hmiomand Mar 21, 2024
25e6b4d
Code cleaning in ScenarioWriter
hmiomand Mar 21, 2024
8d56b42
Removed choco scheduler test from test suite, runs locally but fails …
hmiomand Mar 21, 2024
fd216b0
Moved Scenario file string from Scenario Writer and Parser to constan…
hmiomand Mar 28, 2024
8428a11
Added possibility to run junit5 tests in parallel (only in eclipse fo…
hmiomand Apr 3, 2024
1475153
Added manifest modification omitted in previous commit.
hmiomand Apr 3, 2024
b393156
Removed code smell
hmiomand Apr 4, 2024
d10217a
Explicitly display port manipulation keyboard shortcuts, as displayin…
hmiomand Apr 4, 2024
deef417
Renamed Malleable parameter to Moldable parameter
hmiomand Apr 4, 2024
b8a1b88
Code cleaning
hmiomand Apr 4, 2024
19d0d80
Code cleaning
hmiomand Apr 8, 2024
fb09f71
Code cleaning
hmiomand Apr 8, 2024
bd3a730
Added integration test to test moldable parameter workflow
hmiomand Apr 8, 2024
53f7684
Code cleaning in ui/pisdf/features
hmiomand Apr 9, 2024
4282d7d
Code cleaning in AutoDelaysTask
hmiomand Apr 9, 2024
e1677a5
Fixed .diagram and .pi desync that could happen when using the Undo f…
hmiomand Apr 16, 2024
e84d6e6
Fixed issue with copy/pasting a delays with dependencies
hmiomand Apr 16, 2024
b80d47b < 8000 div class="text-emphasized css-truncate css-truncate-target"> Code cleaning
hmiomand Apr 16, 2024
d1f99f0
Removed most logs during integration tests, improving the consistency…
hmiomand Apr 18, 2024
00d9265
Added clearer error message when codegen path in scenario is invalid.
hmiomand Apr 18, 2024
b72129d
Code cleaning
hmiomand Apr 18, 2024
871ad0f
Fixed naming issue when copy/pasting DataInterfaces
hmiomand Apr 19, 2024
d665ca1
Fixed issue when copy/pasting with a fifo coming out of a ConfigOutpu…
hmiomand Apr 23, 2024
d8653b4
Code cleaning in PasteFeature
hmiomand Apr 23, 2024
6556e76
Fixed issue where deleting a ConfigOutputInterface would not remove t…
hmiomand Apr 23, 2024
7f93e92
Fixed issue where the UNDO action with interface actors would cause a…
hmiomand Apr 23, 2024
9f1d9bc
Code cleaning
hmiomand Apr 23, 2024
ff98d5e
Small refacto in Add*PortFeature
hmiomand Apr 24, 2024
6607f58
[UI] refactoring of Create*Feature with a new abstract parent class
hmiomand Apr 25, 2024
e191d8a
Add explicit indication that MemoryBoundsEstimator gives results in bits
hmiomand Apr 26, 2024
413ab6e
Copy/pasting now recreate dependencies with element copy when possible
hmiomand Apr 29, 2024
67cb50b
Removed old comments
hmiomand Apr 30, 2024
75f097e
[UI] Fixed issue where the diagram itself (the white grid) could be d…
hmiomand Apr 30, 2024
a702c2b
[UI] When attaching a dependency to a Data Interface, the dependency …
hmiomand May 3, 2024
4539537
[UI] The limitation of number of data input/output port of special ac…
hmiomand May 3, 2024
a7a366b
Refactoring in ui/pisdf/properties
hmiomand May 6, 2024
4266ef8
Updated libraries
hmiomand May 6, 2024
95cad71
Added RCPTT test to mess around with copy/pasting and the undo feature
hmiomand May 8, 2024
6bfe422
Improved copy/paste RCPTT test
hmiomand May 9, 2024
6c808ac
Added test for Activity Tasks
hmiomand May 11, 2024
5698530
Added test for BRV Exporter Task
hmiomand May 13, 2024
697a18e
[UI] Refactoring of Add Features
hmiomand May 17, 2024
ca4b7f6
Code cleaning
hmiomand May 17, 2024
96f09a1
Updated graph manipulation rcptt test
hmiomand May 30, 2024
86b1e04
SRDAG transformation now properly append to "_srdag" suffix to graph …
hmiomand May 30, 2024
dea442f
Code cleaning
hmiomand May 30, 2024
b5ea621
Updated graph manipulation rcptt test
hmiomand May 31, 2024
a3d5c4c
Code Cleaning
hmiomand Jun 5, 2024
82f5468
Added RCPTT test for parameter dependency detection in interface
hmiomand Jun 5, 2024
8419e3a
Replaced deprecated calls to AbstractUIPlugin
hmiomand Jun 5, 2024
8379024
Code Cleaning
hmiomand Jun 7, 2024
4a25bf2
Renamed variables to match code style
hmiomand Jun 7, 2024
ff76423
Code Cleaning
hmiomand Jun 10, 2024
6fc73eb
Fix an issue where timing expression resolution during scheduling cou…
hmiomand Jun 10, 2024
c7b5900
Code Cleaning
hmiomand Jun 11, 2024
de8417e
Code Cleaning
hmiomand Jun 13, 2024
851dad3
Code Cleaning
hmiomand Jun 14, 2024
4d9af13
Code cleaning
hmiomand Jun 16, 2024
76f6077
Small code cleaning in spider2 codegen
hmiomand Jun 16, 2024
cabff32
Added test for AutoDelayTask
hmiomand Jun 16, 2024
ffc3ab7
Merge branch 'develop' into test_code_cleaning
hmiomand Jun 16, 2024
d47205e
Code cleaning
hmiomand Jun 20, 2024
5a3ca00
Added use of dependency cache
hmiomand Jun 21, 2024
ed074ed
Fixed CI dependency cache creation
hmiomand Jun 24, 2024
e0ffd2a
Fixed changelog upload action running when not required
hmiomand Jun 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
83 changes: 54 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Build & Test
on:
push:
#pull_request:
pull_request:
schedule:
- cron: '0 7 * * MON'

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
# Prevent workflow from running twice when push to PR from main repo,
# maintains workflow run when PR from forked repo
#if: github.event_name != 'pull_request' ||
# github.event.pull_request.head.repo.full_name !=
# github.event.pull_request.base.repo.full_name
# Prevent workflow from running twice when push to PR from main repo, maintains workflow run when PR from forked repo
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Build & Test
strategy:
matrix:
Expand All @@ -20,58 +22,78 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Git Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.6.3

- name: Restore m2 cache # Only trigger on feature branch
if: github.ref != 'refs/heads/develop'
uses: actions/cache/restore@v4
with:
key: ${{ matrix.os }}-maven-m2- # This lookup will fail, the restore-keys entry will be used, falling back on the most recent cache
path: ~/.m2/repository
restore-keys: ${{ matrix.os }}-maven-m2-

- name: Build & Test
shell: bash
run: releng/build_and_test.sh --ci

- name: Save m2 cache # Only trigger on develop unscheduled
if: github.ref == 'refs/heads/develop' && github.event.schedule != '0 7 * * MON'
uses: actions/cache/save@v4
with:
path: ~/.m2/repository
key: ${{ matrix.os }}-maven-m2-${{ github.run_id }}

- name: Analyze with SONAR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -e -c -Dtycho.mode=maven jacoco:report -Djacoco.dataFile=../../target/jacoco.exec -Dsonar.projectKey=preesm_preesm -Dsonar.token=$SONAR_TOKEN sonar:sonar
# - name: Archive production artifacts
# uses: actions/upload-artifact@v3
# with:
# name: preesm-products
# path: releng/org.preesm.product/target/org.preesm.product-*.zip

- name: Archive Linux product
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-products
path: releng/org.preesm.product/target/products/preesm-*-linux.gtk.x86_64.zip

- name: Archive macOS aarch64 product
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: mac-aarch64-products
path: releng/org.preesm.product/target/products/preesm-*-macosx.cocoa.aarch64.zip

- name: Archive macOS x86_64 product
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: mac-x86-products
path: releng/org.preesm.product/target/products/preesm-*-macosx.cocoa.x86_64.zip

- name: Archive Windows product
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: windows-products
path: releng/org.preesm.product/target/products/preesm-*-win32.win32.x86_64.zip

- name: Generate changelog
if: github.ref == 'refs/heads/develop' && github.event.schedule != '0 7 * * MON'
shell: bash
run: git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-decorate > dev-changelog.txt

- name: Upload changelog
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/develop' && github.event.schedule != '0 7 * * MON'
uses: actions/upload-artifact@v4
with:
name: changelog
path: dev-changelog.txt
Expand All @@ -85,38 +107,41 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Download Linux artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: linux-products

- name: Download Mac aarch64 artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: mac-aarch64-products

- name: Download Mac x86 artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: mac-x86-products

- name: Download Windows artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: windows-products

- name: Download changelog
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: changelog

# - name: Display structure of downloaded files
# run: ls -R
- name: Generate release tag
id: tag
run: |
echo "release_tag=DevBuild_$(date +"%Y.%m.%d_%H-%M")" >> $GITHUB_OUTPUT

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
prerelease: true
draft: true
prerelease: false
tag_name: ${{ steps.tag.outputs.release_tag }}
#body: Check commit history for detailled changes.
body_path: dev-changelog.txt
Expand Down
5 changes: 1 addition & 4 deletions plugins/org.preesm.algorithm/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.ui.forms,
wrapped.net.sourceforge.jexcelapi.jxl,
org.jgrapht.core;bundle-version="1.5.1";visibility:=reexport,
wrapped.com.github.yannrichet.JMathArray;bundle-version="1.0.0",
org.apache.commons.lang3,
org.eclipse.xtend.lib;bundle-version="2.15.0";visibility:=reexport,
org.eclipse.xtext.util;bundle-version="2.15.0",
wrapped.org.ojalgo.ojalgo;bundle-version="44.0.0",
wrapped.jfree.jcommon;bundle-version="1.0.16",
wrapped.org.jfree.jcommon;bundle-version="1.0.24",
wrapped.org.jfree.jfreechart,
wrapped.gov.nist.math.jama;bundle-version="1.0.3",
wrapped.org.jacorb.jacorb-idl-compiler,
com.fasterxml.jackson.core.jackson-core,
com.fasterxml.jackson.module.jackson-module-jsonSchema,
com.fasterxml.jackson.core.jackson-annotations,
com.fasterxml.jackson.core.jackson-databind,
org.preesm.workflow;visibility:=reexport,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private ClusteringHelper() {
*
*/
public static final List<DataInputPort> getExternalyConnectedPorts(final Schedule cluster) {
List<DataInputPort> res = new ArrayList<>();
final List<DataInputPort> res = new ArrayList<>();
final List<AbstractActor> actors = ScheduleUtil.getAllReferencedActors(cluster);
for (final AbstractActor actor : actors) {
final EList<DataInputPort> dataInputPorts = actor.getDataInputPorts();
Expand All @@ -115,7 +115,7 @@ public static final List<DataInputPort> getExternalyConnectedPorts(final Schedul
*/
public static final boolean isActorDelayed(AbstractActor actor) {
// Retrieve every Fifo with delay connected to actor
for (DataPort dp : actor.getAllDataPorts()) {
for (final DataPort dp : actor.getAllDataPorts()) {
if (dp.getFifo().getDelay() != null) {
return true;
}
Expand All @@ -132,11 +132,10 @@ public static final boolean isActorDelayed(AbstractActor actor) {
*/
public static final long getParallelismDepth(Schedule schedule, long iterator) {

if (schedule instanceof HierarchicalSchedule) {
HierarchicalSchedule hierSchedule = (HierarchicalSchedule) schedule;
if (schedule instanceof final HierarchicalSchedule hierSchedule) {
long maxDepth = iterator;
long tmpIterator;
for (Schedule child : hierSchedule.getChildren()) {
for (final Schedule child : hierSchedule.getChildren()) {
tmpIterator = getParallelismDepth(child, iterator);
if (tmpIterator > maxDepth) {
maxDepth = tmpIterator;
Expand All @@ -162,20 +161,20 @@ public static final long getMemorySpaceNeededFor(Schedule schedule) {
long result = 0;
if (schedule instanceof HierarchicalSchedule) {
// Add memory space needed for children in result
for (Schedule child : schedule.getChildren()) {
for (final Schedule child : schedule.getChildren()) {
result += getMemorySpaceNeededFor(child);
}
// If it is a parallel hierarchical schedule with no attached actor, multiply child memory space result by the
// repetition of it
if (!schedule.hasAttachedActor()) {
long rep = schedule.getRepetition();
final long rep = schedule.getRepetition();
result *= rep;
} else {
// Estimate every internal buffer size
PiGraph graph = (PiGraph) ((HierarchicalSchedule) schedule).getAttachedActor();
List<Fifo> fifos = ClusteringHelper.getInternalClusterFifo(graph);
Map<AbstractVertex, Long> brv = PiBRV.compute(graph, BRVMethod.LCM);
for (Fifo fifo : fifos) {
final PiGraph graph = (PiGraph) ((HierarchicalSchedule) schedule).getAttachedActor();
final List<Fifo> fifos = ClusteringHelper.getInternalClusterFifo(graph);
final Map<AbstractVertex, Long> brv = PiBRV.compute(graph, BRVMethod.LCM);
for (final Fifo fifo : fifos) {
result += brv.get(fifo.getSource()) * fifo.getSourcePort().getExpression().evaluate();
}
}
Expand All @@ -197,8 +196,8 @@ public static final long getExecutionTimeOf(Schedule schedule, Scenario scenario
} else {
// Retrieve timing from actors
final List<AbstractActor> actors = ScheduleUtil.getAllReferencedActors(schedule);
AbstractActor actor = actors.get(0);
long actorTiming = scenario.getTimings().evaluateExecutionTimeOrDefault(actor, component);
final AbstractActor actor = actors.get(0);
final long actorTiming = scenario.getTimings().evaluateExecutionTimeOrDefault(actor, component);
timing = schedule.getRepetition() * actorTiming;
}

Expand All @@ -210,15 +209,15 @@ private static long getExecutionTimeOfHierarchical(Schedule schedule, Scenario s
// If schedule is sequential
if (schedule instanceof SequentialSchedule) {
// Sum timings of all childrens together
for (Schedule child : schedule.getChildren()) {
for (final Schedule child : schedule.getChildren()) {
timing += getExecutionTimeOf(child, scenario, component);
}
} else {
// If schedule is parallel
// Search for the maximun time taken by childrens
long max = 0;
for (Schedule child : schedule.getChildren()) {
long result = getExecutionTimeOf(child, scenario, component);
for (final Schedule child : schedule.getChildren()) {
final long result = getExecutionTimeOf(child, scenario, component);
if (result > max) {
max = result;
}
Expand Down Expand Up @@ -264,10 +263,9 @@ public static Fifo getOutsideIncomingFifo(final Fifo inFifo) {
final AbstractActor sourceActor = (AbstractActor) inFifo.getSource();
if (sourceActor instanceof DataInputInterface) {
return ((DataInputPort) ((DataInputInterface) sourceActor).getGraphPort()).getIncomingFifo();
} else {
throw new PreesmRuntimeException(
"ClusteringHelper: cannot find outside-cluster incoming fifo from " + inFifo.getTarget());
}
throw new PreesmRuntimeException(
"ClusteringHelper: cannot find outside-cluster incoming fifo from " + inFifo.getTarget());
}

/**
Expand All @@ -281,10 +279,9 @@ public static Fifo getOutsideOutgoingFifo(final Fifo inFifo) {
final AbstractActor targetActor = (AbstractActor) inFifo.getTarget();
if (targetActor instanceof DataOutputInterface) {
return ((DataOutputPort) ((DataOutputInterface) targetActor).getGraphPort()).getOutgoingFifo();
} else {
throw new PreesmRuntimeException(
"ClusteringHelper: cannot find outside-cluster outgoing fifo from " + inFifo.getSource());
}
throw new PreesmRuntimeException(
"ClusteringHelper: cannot find outside-cluster outgoing fifo from " + inFifo.getSource());
}

/**
Expand All @@ -298,9 +295,8 @@ public static Parameter getSetterParameter(final ConfigInputPort port) {
final ISetter setter = port.getIncomingDependency().getSetter();
if (setter instanceof ConfigInputInterface) {
return getSetterParameter(((ConfigInputInterface) port.getIncomingDependency().getSetter()).getGraphPort());
} else {
return (Parameter) setter;
}
return (Parameter) setter;
}

/**
Expand All @@ -314,7 +310,7 @@ public static Parameter getSetterParameter(final ConfigInputPort port) {
*/
public static List<Pair<AbstractActor, AbstractActor>> getClusterizableCouples(final PiGraph graph,
final Map<AbstractVertex, Long> brv, Scenario scenario) {
List<Pair<AbstractActor, AbstractActor>> couples = PiSDFMergeabilty.getConnectedCouple(graph, brv);
final List<Pair<AbstractActor, AbstractActor>> couples = PiSDFMergeabilty.getConnectedCouple(graph, brv);
// Remove couples of actors that are not in the same constraints
ClusteringHelper.removeConstrainedCouples(couples, scenario);
return couples;
Expand All @@ -327,11 +323,10 @@ public static List<Pair<AbstractActor, AbstractActor>> getClusterizableCouples(f
* scenario
*/
public static void removeConstrainedCouples(List<Pair<AbstractActor, AbstractActor>> couples, Scenario scenario) {
List<Pair<AbstractActor, AbstractActor>> tmpCouples = new LinkedList<>();
tmpCouples.addAll(couples);
final List<Pair<AbstractActor, AbstractActor>> tmpCouples = new LinkedList<>(couples);
couples.clear();
for (Pair<AbstractActor, AbstractActor> couple : tmpCouples) {
List<ComponentInstance> componentList = getListOfCommonComponent(
for (final Pair<AbstractActor, AbstractActor> couple : tmpCouples) {
final List<ComponentInstance> componentList = getListOfCommonComponent(
Arrays.asList(couple.getLeft(), couple.getRight()), scenario);
if (!componentList.isEmpty()) {
couples.add(couple);
Expand All @@ -347,10 +342,9 @@ public static void removeConstrainedCouples(List<Pair<AbstractActor, AbstractAct
* @return List of components
*/
public static List<ComponentInstance> getListOfCommonComponent(List<AbstractActor> actorList, Scenario scenario) {
List<ComponentInstance> globalList = new LinkedList<>();
globalList.addAll(scenario.getPossibleMappings(actorList.get(0)));
for (AbstractActor actor : actorList) {
List<ComponentInstance> componentList = scenario.getPossibleMappings(actor);
final List<ComponentInstance> globalList = new LinkedList<>(scenario.getPossibleMappings(actorList.get(0)));
for (final AbstractActor actor : actorList) {
final List<ComponentInstance> componentList = scenario.getPossibleMappings(actor);
globalList.retainAll(componentList);
}
return globalList;
Expand Down
Loading
Loading
0