Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
293 commits
Select commit Hold shift + click to select a range
1662de5
feat: Changed from IFormula input to FeatureModel input in analysis and
Oct 2, 2025
ae4d50c
feat: Added functionality for computing FeatureDensity,
Oct 2, 2025
57b3010
test: reshaped the tests
Oct 2, 2025
fe02b10
refactor: assigned more specific names to variables and adjusted imports
FloBeese Oct 5, 2025
2e0ed15
chores: resolved star imports to specific imports. removed console pr…
FloBeese Oct 5, 2025
3b92cd5
docs: added documentation to the classes Visitors and Computational for
Oct 6, 2025
f883610
docs: added some extra docs. fix: corrected the OperatorDistribution,…
Oct 6, 2025
4ebb6d5
feat basic start for Simple Tree Properties
BvH19 Oct 1, 2025
cf49e34
feat basic start for Simple Tree Properties
BvH19 Oct 1, 2025
7788b6d
feat visitor implementation of leaf counter
BvH19 Oct 1, 2025
044ce33
feat: "average number of children" implemented + docs and tests for "…
BvH19 Oct 2, 2025
49535b6
feat: "group distribution" implemented.
BvH19 Oct 2, 2025
7254971
refactor: deleted unnecessary code copied from templates
BvH19 Oct 2, 2025
491f451
test: work towards a tree generator that maps onto the example one fr…
BvH19 Oct 2, 2025
2e4cec9
style: used gradle formatter
BvH19 Oct 2, 2025
a34fea8
test: every test now checks two trees
BvH19 Oct 2, 2025
617eab4
test: every test now checks two trees
BvH19 Oct 2, 2025
f387ed4
test, style: removed temp test
BvH19 Oct 2, 2025
25da967
refactor
BvH19 Oct 2, 2025
a91e4d0
feat: can gather analysis for CSV output, can export stats to strings
BvH19 Oct 2, 2025
65f7b0a
test: added tests for a minimal tree with only 1 node, the root.
BvH19 Oct 4, 2025
52c7d12
refactor
BvH19 Oct 6, 2025
02999dd
feat: now also counts other potential groups.
BvH19 Oct 6, 2025
6e7a46d
refactor: now uses Double instead of Float as per supervisor request
BvH19 Oct 6, 2025
d9e55db
refactor: now uses Double instead of Float as per supervisor request
BvH19 Oct 6, 2025
b84a170
refactor: now uses Double instead of Float as per supervisor request
BvH19 Oct 6, 2025
6fe127e
refactor: switched all calculations to the Computations wrapper.
BvH19 Oct 6, 2025
6d963cc
Feat: connecting of functionality of other teams WIP
Oct 6, 2025
be7259d
doc: indicated return values of hashmap
BvH19 Oct 7, 2025
49e0fb8
feat: connecting to functionality of other teams
Oct 7, 2025
a490e89
feat: connecting to functionality of other teams WIP
Oct 7, 2025
d44ab8a
fix: attempted fix for appending strings of nested map
BvH19 Oct 7, 2025
3855bde
feat: concluded connecting to other groups functionality
Oct 7, 2025
a4db903
test: continuing work on tests
Oct 7, 2025
a7db2fa
test: added string difference finder method
BvH19 Oct 7, 2025
7c74082
test: tests concluded
Oct 7, 2025
5ab6fcb
test: tests concluded
Oct 7, 2025
598c324
docs: added test stubs + fixed Childen / Children typo
BvH19 Oct 7, 2025
64bc0c8
docs: added docs for the last few methods
BvH19 Oct 7, 2025
1bdede4
docs: added documentation
Oct 7, 2025
b98922e
test: improved test of print function
Oct 7, 2025
cb9590f
refactor: removed test method
BvH19 Oct 7, 2025
8389590
Merge branch 'main' into Branch_KnutKilian
y0110166 Oct 7, 2025
70110da
Merge pull request #5 from BvH19/Branch_KnutKilian
BvH19 Oct 7, 2025
a59aba9
feat: general structure of functionality
Oct 7, 2025
571583d
feat: added temprery class JSON and AnalysisTree.
Oct 7, 2025
af9b651
feat: just completed some functionality in the class AnalysisTree
Oct 8, 2025
d589055
feat: add a Tree class to manage the analysis results of a feature model
Oct 8, 2025
f3425a8
Merge branch 'main' of github.com:BvH19/FeatJAR-feature-model
Oct 8, 2025
fbf71df
feat: general functionality
Oct 8, 2025
7d39e3d
chore: removed unneeded imports and semicolons
BvH19 Oct 8, 2025
a68e6b9
refactor: cleaned up code structure
BvH19 Oct 8, 2025
91f4d3a
refactor: cleaned up code structure
BvH19 Oct 8, 2025
0034149
style: removed unused IOException throws
BvH19 Oct 8, 2025
65fa95c
style: replaced redundant call: Instead of building a string with str…
BvH19 Oct 8, 2025
3f72088
doc: added missing comments
BvH19 Oct 8, 2025
ac7149d
style: removed redundant <> specification
BvH19 Oct 8, 2025
c8ef131
style: adjusted visibility scope of enum AnalysesScope to be consiste…
BvH19 Oct 8, 2025
2de8821
feat: Created a TreeVisitor class that create map from an AnalysisTre…
Oct 8, 2025
9214855
feat: add a Tree class to manage the analysis results of a feature model
Oct 8, 2025
35c8fba
test: even more tests for input/output
Oct 8, 2025
6fdfea8
style: removed unnecessary IOException throws, used existing FormatCo…
BvH19 Oct 8, 2025
d52449e
feat: information loss prototyping
Oct 8, 2025
8a268e0
feat: prototype for feature support map (for info loss calculations)
BvH19 Oct 8, 2025
35ee695
test: added test to check for analysistree functionality, added test …
FloBeese Oct 8, 2025
2e972c2
feat: fleshed out infolossmap prototype, needs to be tested
BvH19 Oct 8, 2025
1e8b8d5
style: cleaned up imports and unnecessary IOException throw declarations
BvH19 Oct 8, 2025
f86dced
test: built a small test for the info loss map
BvH19 Oct 8, 2025
8aebbf8
feat: added small comparison function to infoloss support levels for …
BvH19 Oct 9, 2025
7dcee38
fix: A problem with the transformation of a hson file/object to an An…
Oct 9, 2025
4845021
test: updatede test to check cloneNode. docs: added documentation to …
FloBeese Oct 9, 2025
747e6dc
docs: Added documentation to the analysistreevisitor
FloBeese Oct 9, 2025
07855dd
feat: added command flag to allow overwriting the output file
Oct 9, 2025
cc38f5f
test: added a test for saving and loading with the JSONAnalysisFormat
Oct 9, 2025
3a4439d
Merge branch 'JSONExport' of github.com:BvH19/FeatJAR-feature-model i…
Oct 9, 2025
988b3db
feat: supported in- and output formats are now dynamically generated …
BvH19 Oct 9, 2025
1f6f33f
style: gradlew style
Oct 9, 2025
29279ef
test: added final test for checking content of created file
Oct 9, 2025
f9091c3
style: applied styleguide
Oct 9, 2025
77a6950
doc: added doc stubs
BvH19 Oct 9, 2025
82aaba7
doc: added test comments
BvH19 Oct 9, 2025
26acaec
feat: added first implementation for the yamlAnalysisFormater. test: …
Oct 9, 2025
655e5af
refactor: improved quality of tests
Oct 9, 2025
5053f60
doc: added test documentation
BvH19 Oct 9, 2025
8408eac
fix:restored deleted file. test:added a simple yaml serialization loa…
FloBeese Oct 9, 2025
c8c55d1
test: prototype logger evaluation
Oct 9, 2025
7dacaeb
Merge remote-tracking branch 'teamprojekt/Branch_KnutKilian' into Bra…
BvH19 Oct 9, 2025
f00124c
style: small import cleanup
BvH19 Oct 9, 2025
164b5be
fix: fixed file not being deleted post-test
BvH19 Oct 9, 2025
a899036
fix: infoLossMapTest fixed
Oct 10, 2025
c436e48
refactor: removed anti patterns
Oct 10, 2025
2ab871a
style: renamed SupportLevels: FULL -> YES; NONE -> NO
BvH19 Oct 10, 2025
8cbf3fa
fix: updated test t include new string output
Oct 10, 2025
b0d276a
feat: infolossmap builder now auto-fills unset fileinfos to support l…
BvH19 Oct 10, 2025
db7721c
refactor: info loss map is now built in a more structured way, enforc…
BvH19 Oct 10, 2025
8be7f5f
feat: prototypical implementation of extension point based output for…
BvH19 Oct 10, 2025
45ea170
style: removed commented out content, applied spotlessapply
Oct 10, 2025
7edf3eb
Merge remote-tracking branch 'teamprojekt/Branch_KnutKilian' into Bra…
BvH19 Oct 10, 2025
ac3cf17
feat: prototypical implementation of extension point based output for…
BvH19 Oct 10, 2025
57e6971
style: minimal minor clean up
Oct 10, 2025
265c1dc
feat: null check for supported file extensions
BvH19 Oct 10, 2025
0c14556
doc: added remaining method documentations
BvH19 Oct 10, 2025
ad0f320
style: improved documentation
Oct 10, 2025
7c8fd19
doc: fixed authorship in docs
BvH19 Oct 10, 2025
d65b028
Merge remote-tracking branch 'teamprojekt/Branch_KnutKilian' into Bra…
BvH19 Oct 10, 2025
0bb811d
fix: various small fixes
BvH19 Oct 10, 2025
b15f587
doc | refactor: small fixes
BvH19 Oct 10, 2025
e07a11a
refactor: implemented StringBuilder instead of String
Oct 10, 2025
a80692d
test: added more tests
Oct 10, 2025
9b8257b
fix: tests are working now
Oct 10, 2025
ac58750
refactor: replaced supported file format builder with stream solution
BvH19 Oct 10, 2025
7f04b54
style: removed redundant null assignment
BvH19 Oct 10, 2025
76288ef
doc: added docs to unit tests
BvH19 Oct 10, 2025
9a5d02d
feat: added csvformat and printer. refactor: regarding yaml and json …
Oct 10, 2025
fdd5e9c
style: fix imports and delete debug statements
Oct 10, 2025
3a60cf8
style: fix more imports and delete debug statements
Oct 10, 2025
65bf47e
Merge branch 'main' into Branch_KnutKilian
BvH19 Oct 10, 2025
9be6250
Merge branch 'main' into CSV
FloBeese Oct 10, 2025
53cbefe
Merge pull request #6 from BvH19/Branch_KnutKilian
BvH19 Oct 10, 2025
a99ad17
Merge branch 'main' into CSV
FloBeese Oct 13, 2025
8a2c654
refactor: improved functionality for logging across different operati…
Oct 13, 2025
f69e402
docs: added missing doc. style: renamed variables
FloBeese Oct 13, 2025
573dcc2
Merge branch 'CSV' of github.com:BvH19/FeatJAR-feature-model into CSV
FloBeese Oct 13, 2025
5dd1f19
Merge pull request #7 from BvH19/CSV
FloBeese Oct 13, 2025
8b87d98
feat: created files for next story card
Oct 13, 2025
fa23c75
git: pulled files from analysis tree to branch
Oct 13, 2025
6688bc2
Merge branch 'CSV' of github.com:BvH18/FeatJAR-feature-model into sam…
Oct 13, 2025
a6acd98
tests: adjusted tests for io
FloBeese Oct 13, 2025
f528650
test: modified one test
Oct 13, 2025
ce526be
style: formatting by gradlew spotless
FloBeese Oct 13, 2025
d4ab038
Merge pull request #8 from BvH19/CSV
BvH19 Oct 13, 2025
8b6b4fb
chore: added XChart dependency to gradle
BvH19 Oct 13, 2025
ce96e37
feat: overwrite option for printstats. integrated with components to …
Oct 13, 2025
42055d8
feat prototype visualization
BvH19 Oct 13, 2025
51d4e6a
Merge remote-tracking branch 'refs/remotes/teamprojekt/main' into XCh…
BvH19 Oct 14, 2025
196d91c
Merge branch 'CSV' of github.com:BvH19/FeatJAR-feature-model into sam…
Oct 14, 2025
2e0fcd0
feat: added computations for sample properties. test: added tests for…
Oct 14, 2025
39e6860
feat: Abstract class for visualizer implemented.
BvH19 Oct 14, 2025
5d404ce
feat: started with the implementation of the ComputeUniformity class
Oct 14, 2025
5665249
test: implemented tests for file writing formats (WIP-json)
Oct 14, 2025
f74137f
fix: relaced wrong input file
Oct 14, 2025
6ad811d
Merge pull request #9 from BvH19/Branch_KnutKilian
y0110166 Oct 14, 2025
2485713
fix: corrected behavior of ComputeFormula to take constraints into ac…
FloBeese Oct 14, 2025
f00e83f
feat: testing reading/writing BooleanAssignmentList files WIP
Oct 14, 2025
4e5bdb6
feat: Analysis Tree now integrated into chart building pipeline + bui…
BvH19 Oct 14, 2025
399ed2b
doc: added small todo reminder for ourselves
BvH19 Oct 14, 2025
9e808a8
ConfigurationFormat story card started
Oct 14, 2025
b76e55a
feat: continued the development of ComputeUniformity.
Oct 14, 2025
8e53e13
chore: added XChart dependency to gradle
BvH19 Oct 13, 2025
0961e25
feat prototype visualization
BvH19 Oct 13, 2025
cba49d1
feat: Abstract class for visualizer implemented.
BvH19 Oct 14, 2025
c0d401f
feat: Analysis Tree now integrated into chart building pipeline + bui…
BvH19 Oct 14, 2025
802cec7
doc: added small todo reminder for ourselves
BvH19 Oct 14, 2025
ab31c89
feat: tried to refractoring and streamlining the extraction of the An…
Oct 14, 2025
4d229ae
Merge branch 'XChartPlotting' of github.com:BvH19/FeatJAR-feature-mod…
Oct 14, 2025
7455171
doc: added small todo reminder
BvH19 Oct 14, 2025
75950f0
fix: fixed typo
Oct 14, 2025
17a9a55
refactor: redone the data structure for the extracted Analysis Tree
BvH19 Oct 15, 2025
1cfa4a5
feat: format conversion generally working
Oct 15, 2025
70d33bd
refactor | feat: method for building pie charts transferred to abstra…
BvH19 Oct 15, 2025
137bd7d
doc: general doc updates
BvH19 Oct 15, 2025
94658eb
style: removed dummy exception handling
BvH19 Oct 15, 2025
bbcebb0
style: renamed class to be more succint
BvH19 Oct 15, 2025
d84cb2a
refactor: improved logging for empty charts
BvH19 Oct 15, 2025
6210651
feat: Constraint Operator Distributions charts can now also be displayed
BvH19 Oct 15, 2025
83b6b77
feat: Visualizer can now export to pdf!
BvH19 Oct 15, 2025
216eae5
feat: finished computation uniformity. test: added corresponding test…
Oct 15, 2025
ad83fc4
test: wrote a first round of tests
BvH19 Oct 15, 2025
4b74b07
refactor: slightly smarter reuse of polymorphs
BvH19 Oct 15, 2025
6ab001e
doc: small reminder to test with other feature models
BvH19 Oct 15, 2025
5600073
test: added tests for live preview
BvH19 Oct 15, 2025
1d60785
test: added tests, refactored main file and improved docs
Oct 15, 2025
8c83a33
test: added tests for operator constraints
BvH19 Oct 15, 2025
2182877
feat: calculated commonality for deselected and undefined cases
Oct 15, 2025
62907e2
fix: corrected behavior of json parsing/serializing. tests: fixed jso…
FloBeese Oct 15, 2025
9ab588b
test: removed test that had confusing popups
BvH19 Oct 15, 2025
ea5650a
wip. last push of day
Oct 15, 2025
e98cfe7
feat: added basic font customization
BvH19 Oct 15, 2025
80387b3
fix: used correct warning method for pdfexport with empty chart list
BvH19 Oct 15, 2025
d31c0a4
feat: Added buildBoxCharts functionality to AVisualFeatureModelStats …
Oct 15, 2025
d47d603
Merge branch 'XChartPlotting' of github.com:BvH19/FeatJAR-feature-mod…
Oct 15, 2025
e4d5f00
feat | test: changing chart height or width now rebuilds the charts w…
BvH19 Oct 16, 2025
48de056
fix: sample feature model now set optional/mandatory feature settings…
BvH19 Oct 16, 2025
a2f648c
test: updated the computeUniformity test
Oct 16, 2025
09304ee
test: added new tests for pdf export with directory creation
BvH19 Oct 16, 2025
55e0f34
feat: pdfexport now creates directory if it does not already exist. d…
BvH19 Oct 16, 2025
660712a
chore: deleted personal test class
BvH19 Oct 16, 2025
575f04c
fix: extended catch scope of pdf export
BvH19 Oct 16, 2025
abf0002
doc: enhanced docs with links
BvH19 Oct 16, 2025
59ba1e4
doc: added doc to both class and constructor, and updated child docs …
BvH19 Oct 16, 2025
81adede
doc: added missing doc for helper method
BvH19 Oct 16, 2025
509043d
style: ran spotless apply for code style consistency
BvH19 Oct 16, 2025
bfb6a2f
doc: added missing credits
BvH19 Oct 16, 2025
6708bef
feat: incorporated feedback: Chart title can be manually set, pie cha…
BvH19 Oct 16, 2025
b4823c1
feat: added cli for sampleproperties. tests: added tests for cli incl…
FloBeese Oct 16, 2025
31295a4
Merge branch 'sample_properties' of github.com:BvH19/FeatJAR-feature-…
FloBeese Oct 16, 2025
06f4e74
feat: pie chart builder can catch invalid negative input numbers
BvH19 Oct 16, 2025
c4aa5a0
style: code formatting according to spotless and licensing
FloBeese Oct 16, 2025
a1b31b2
style: use specific filenames for tests.
BvH19 Oct 16, 2025
e0122a7
fix: changed name of root of resulting analysistree
FloBeese Oct 16, 2025
ed08877
doc: added warning about prototype method
BvH19 Oct 16, 2025
5503cb2
refactor: refactoring of functionality regarding --format option, sty…
Oct 16, 2025
3028a27
refactor: changed scope of variables in computional to public.
Oct 16, 2025
f4a8fb0
Merge branch 'sample_properties' of github.com:BvH19/FeatJAR-feature-…
Oct 16, 2025
fdb0cc9
feat: added flag to uniformity statistics unprocessed
FloBeese Oct 16, 2025
3b1447c
style: properly removed code that was commented out
BvH19 Oct 16, 2025
1054460
test: added test for unprocessed flag
FloBeese Oct 16, 2025
4f06638
Merge pull request #11 from BvH19/XChartPlotting
BvH19 Oct 16, 2025
5efaab5
Merged remote changes
FloBeese Oct 16, 2025
14619a8
chore: fixed minor issues
Oct 16, 2025
34c9d9d
Merge pull request #13 from BvH19/Branch_KnutKilian
y0110166 Oct 16, 2025
297a732
fix: solved an error that could happen if Feature model or assignment…
Oct 16, 2025
5aacb2e
Merge branch 'sample_properties' of github.com:BvH19/FeatJAR-feature-…
Oct 16, 2025
3a57fc1
Merge pull request #10 from BvH19/sample_properties
BvH19 Oct 16, 2025
ebca263
fix: removed a minor issues in a string used for a test
Oct 16, 2025
557f74a
fix: Pie Chart builder now checks for negative value without problema…
BvH19 Oct 16, 2025
d153986
Merge remote-tracking branch 'teamprojekt/XChartPlotting' into XChart…
BvH19 Oct 16, 2025
fbd1d20
Merge pull request #14 from BvH19/XChartPlotting
BvH19 Oct 16, 2025
57cbdb5
Merge pull request #15 from BvH19/Branch_KnutKilian
y0110166 Oct 16, 2025
bbfaa69
test fix: invalidPDFPath() test now works under Linux and Windows!
BvH19 Oct 16, 2025
3268971
Merge pull request #16 from BvH19/XChartPlotting
BvH19 Oct 16, 2025
452e7f0
feat: adding command paramenter for visualize statistics. WIP
Oct 16, 2025
957cd1a
fix: fixed some FeatJAR.initialize problems. And some String compare …
Oct 17, 2025
2f823c3
Merge branch 'main' of github.com:BvH18/FeatJAR-feature-model
Oct 17, 2025
606526e
refactor(WIP): refactored test. created dataprovider for similiar fun…
FloBeese Oct 17, 2025
0c16c0e
refactor: removed unused code and extracted duplicate code to provide…
FloBeese Oct 17, 2025
60799e5
docs: added docs to TestDataProvider. style: removed semicolon
FloBeese Oct 17, 2025
2947492
Merge branch 'main' into TestDataProvider
FloBeese Oct 17, 2025
aad1423
docs:added missing doc
FloBeese Oct 17, 2025
de41059
Merge branch 'TestDataProvider' of github.com:BvH19/FeatJAR-feature-m…
FloBeese Oct 17, 2025
554b18b
feat: visualization works with three command line parameters. Attempt…
Oct 17, 2025
0b68e81
refactor: moved more general useful functions to TestDataProvider
FloBeese Oct 17, 2025
ab6c185
refactor: analysis tree data extraction offloaded to dedicated visitor
BvH19 Oct 17, 2025
b8f5d2d
chore: deleted experimental class
BvH19 Oct 17, 2025
f4cbfde
feat: displaying and exporting charts externally can now be done via …
BvH19 Oct 17, 2025
d5d44a1
style: removed "this" call on static method
BvH19 Oct 17, 2025
9447950
Merge pull request #17 from BvH19/TestDataProvider
BvH19 Oct 17, 2025
b327a50
feat: implemented functionality for visualization
Oct 17, 2025
40e7b5d
Remove unnecessary semicolon
y0110166 Oct 17, 2025
6c597d7
Merge pull request #20 from BvH19/Branch_KnutKilian
y0110166 Oct 17, 2025
c5f1cf9
style: renaming of FormatConversion to FeatureModelFormatConversion t…
Oct 17, 2025
03c6571
Merge pull request #21 from BvH19/refactoring_KnutKilian
y0110166 Oct 17, 2025
55d2dd6
Merge pull request #19 from BvH19/XChartPlotting
y0110166 Oct 17, 2025
8520f5b
style: final change to camelCase
FloBeese Oct 17, 2025
c1908dd
Merge pull request #24 from BvH19/StyleCamelCaseV2
y0110166 Oct 17, 2025
97fa851
moved computationals to a computation package and TreeVisitors to a T…
Oct 17, 2025
b15e8b8
Merge pull request #25 from BvH19/refactoringForMain
y0110166 Oct 17, 2025
afbcba4
fix: fix for gradle build.
Oct 17, 2025
50ee095
Merge branch 'main' of github.com:BvH19/FeatJAR-feature-model
Oct 17, 2025
b8dcda3
chore: ran spotless apply
BvH19 Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
/.classpath
/.idea/
/.settings/
/bin/
/bin/
/model_invalidInput.dot
/export.pdf
/src/test/java/de/featjar/feature/model/visualization/VisualizeFeatureModelStatsTest.pdf
/src/main/java/de/featjar/feature/model/analysis/visualization/Testtmp.java
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ plugins {
dependencies {
api 'de.featjar:formula'
api testFixtures('de.featjar:formula')
api 'de.featjar:formula-analysis-javasmt'
implementation 'org.json:json:20240303'
implementation 'org.yaml:snakeyaml:2.5'
implementation 'tools.jackson.dataformat:jackson-dataformat-csv:3.0.0'
implementation 'org.knowm.xchart:xchart:3.8.8'
implementation 'de.rototor.pdfbox:graphics2d:3.0.5'
}

license {
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ plugins {
}

includeBuild '../formula'
includeBuild '../formula-analysis-javasmt'
106 changes: 106 additions & 0 deletions src/main/java/de/featjar/feature/model/analysis/AnalysisTree.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright (C) 2025 FeatJAR-Development-Team
*
* This file is part of FeatJAR-feature-model.
*
* feature-model is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License,
* or (at your option) any later version.
*
* feature-model is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with feature-model. If not, see <https://www.gnu.org/licenses/>.
*
* See <https://github.com/FeatureIDE/FeatJAR-feature-model> for further information.
*/
package de.featjar.feature.model.analysis;

import de.featjar.base.tree.structure.ATree;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
* A tree of nodes with a given name and some data.
*
* @param <T> type of value this node holds
* @author Mohammad Khair Almekkawi
* @author Florian Beese
*/
public class AnalysisTree<T> extends ATree<AnalysisTree<?>> {

private String name;
private T value;

public AnalysisTree(String name, T value) {
this.name = name;
this.value = value;
}

public AnalysisTree(String name, AnalysisTree<?> firstchild, AnalysisTree<?>... children) {
super(children.length + 1);
ArrayList<AnalysisTree<?>> allChildren = new ArrayList<>();
allChildren.add(firstchild);
java.util.Collections.addAll(allChildren, children);
if (allChildren.size() > 0) super.setChildren(allChildren);
this.name = name;
}

public AnalysisTree(String name, List<? extends AnalysisTree<?>> children) {
super(children.size());
super.setChildren(children);
this.name = name;
}

public String getName() {
return this.name;
}

public T getValue() {
return this.value;
}

public AnalysisTree(AnalysisTree<T> analysisTree) {
this.name = analysisTree.name;
this.value = analysisTree.value;
}

@Override
public AnalysisTree<?> cloneNode() {
return new AnalysisTree<>(this);
}

@Override
public boolean equalsNode(AnalysisTree<?> other) {
if (other.value == null && this.value != null) {
return false;
}
if (other.value != null && this.value == null) {
return false;
}
if (this.value == null && other.value == null) {
return this.name.equals(other.name);
}
return this.name.equals(other.name) && this.value.equals(other.value);
}

@Override
public int hashCodeNode() {
return Objects.hash(this.getClass(), this.name, this.value);
}

@Override
public String toString() {
if (this.value == null) {
return "Name: " + this.name + " - Value: " + this.value + " - Value class: " + "No class";
} else {
return "Name: " + this.name + " - Value: " + this.value + " - Value class: "
+ this.value.getClass().getName();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (C) 2025 FeatJAR-Development-Team
*
* This file is part of FeatJAR-feature-model.
*
* feature-model is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License,
* or (at your option) any later version.
*
* feature-model is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with feature-model. If not, see <https://www.gnu.org/licenses/>.
*
* See <https://github.com/FeatureIDE/FeatJAR-feature-model> for further information.
*/
package de.featjar.feature.model.analysis.computation;

import de.featjar.base.computation.AComputation;
import de.featjar.base.computation.Dependency;
import de.featjar.base.computation.IComputation;
import de.featjar.base.computation.Progress;
import de.featjar.base.data.Result;
import de.featjar.formula.assignment.BooleanAssignment;
import de.featjar.formula.assignment.BooleanAssignmentList;
import java.util.LinkedHashMap;
import java.util.List;

/**
* Compute how often features are selected, deselected, or undefined.
*
* @author Mohammad Khair Almekkawi
* @author Florian Beese
*/
public class ComputeDistributionFeatureSelections extends AComputation<LinkedHashMap<String, Integer>> {

public static final Dependency<BooleanAssignmentList> BOOLEAN_ASSIGNMENT_LIST =
Dependency.newDependency(BooleanAssignmentList.class);

public ComputeDistributionFeatureSelections(IComputation<BooleanAssignmentList> booleanAssignmentList) {
super(booleanAssignmentList);
}

@Override
public Result<LinkedHashMap<String, Integer>> compute(List<Object> dependencyList, Progress progress) {
BooleanAssignmentList booleanAssigmenAssignmentList = BOOLEAN_ASSIGNMENT_LIST.get(dependencyList);
LinkedHashMap<String, Integer> selectionDistribution = new LinkedHashMap<String, Integer>();
selectionDistribution.put("selected", 0);
selectionDistribution.put("deselected", 0);
selectionDistribution.put("undefined", 0);

for (BooleanAssignment assignment : booleanAssigmenAssignmentList.getAll()) {
selectionDistribution.replace(
"deselected", assignment.countNegatives() + selectionDistribution.get("deselected"));
selectionDistribution.replace(
"selected", assignment.countPositives() + selectionDistribution.get("selected"));
selectionDistribution.replace(
"undefined",
-assignment.countNonZero()
+ booleanAssigmenAssignmentList
.getVariableMap()
.getVariableNames()
.size()
+ selectionDistribution.get("undefined"));
}
return Result.of(selectionDistribution);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2025 FeatJAR-Development-Team
*
* This file is part of FeatJAR-feature-model.
*
* feature-model is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License,
* or (at your option) any later version.
*
* feature-model is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with feature-model. If not, see <https://www.gnu.org/licenses/>.
*
* See <https://github.com/FeatureIDE/FeatJAR-feature-model> for further information.
*/
package de.featjar.feature.model.analysis.computation;

import de.featjar.base.computation.AComputation;
import de.featjar.base.computation.Dependency;
import de.featjar.base.computation.IComputation;
import de.featjar.base.computation.Progress;
import de.featjar.base.data.Result;
import de.featjar.base.tree.Trees;
import de.featjar.feature.model.IFeatureTree;
import de.featjar.feature.model.analysis.visitor.TreeAvgChildrenCounterTreeVisitor;
import java.util.List;

/**
* Calculates the number of features that have no child features.
*
* @author Benjamin von Holt
*/
public class ComputeFeatureAverageNumberOfChildren extends AComputation<Double> {
protected static final Dependency<IFeatureTree> FEATURE_TREE = Dependency.newDependency(IFeatureTree.class);

public ComputeFeatureAverageNumberOfChildren(IComputation<IFeatureTree> featureTree) {
super(featureTree);
}

@Override
public Result<Double> compute(List<Object> dependencyList, Progress progress) {
IFeatureTree tree = FEATURE_TREE.get(dependencyList);
return Trees.traverse(tree, new TreeAvgChildrenCounterTreeVisitor());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Copyright (C) 2025 FeatJAR-Development-Team
*
* This file is part of FeatJAR-feature-model.
*
* feature-model is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License,
* or (at your option) any later version.
*
* feature-model is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with feature-model. If not, see <https://www.gnu.org/licenses/>.
*
* See <https://github.com/FeatureIDE/FeatJAR-feature-model> for further information.
*/
package de.featjar.feature.model.analysis.computation;

import de.featjar.base.computation.AComputation;
import de.featjar.base.computation.Dependency;
import de.featjar.base.computation.IComputation;
import de.featjar.base.computation.Progress;
import de.featjar.base.data.Result;
import de.featjar.formula.assignment.BooleanAssignment;
import de.featjar.formula.assignment.BooleanAssignmentList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
* Compute how often features are selected, deselected, or undefined per feature.
*
* @author Mohammad Khair Almekkawi
* @author Florian Beese
*/
public class ComputeFeatureCounter extends AComputation<LinkedHashMap<String, Integer>> {

protected static final Dependency<BooleanAssignmentList> BOOLEAN_ASSIGMENT_LIST =
Dependency.newDependency(BooleanAssignmentList.class);

public ComputeFeatureCounter(IComputation<BooleanAssignmentList> booleanAssigmentList) {
super(booleanAssigmentList);
}

@Override
public Result<LinkedHashMap<String, Integer>> compute(List<Object> dependencyList, Progress progress) {
BooleanAssignmentList booleanAssignmentList = BOOLEAN_ASSIGMENT_LIST.get(dependencyList);
LinkedHashMap<String, Integer> featureCounter = new LinkedHashMap<String, Integer>();

for (int index : booleanAssignmentList.getVariableMap().getIndices()) {
featureCounter.put(index + "_selected", 0);
featureCounter.put(index + "_deselected", 0);
featureCounter.put(index + "_undefined", 0);
}

for (BooleanAssignment assignment : booleanAssignmentList.getAll()) {
for (int index : booleanAssignmentList.getVariableMap().getIndices()) {
if (assignment.contains(index)) {
featureCounter.replace(index + "_selected", featureCounter.get(index + "_selected") + 1);
} else if (assignment.containsAnyNegated(index)) {
featureCounter.replace(index + "_deselected", featureCounter.get(index + "_deselected") + 1);
} else {
featureCounter.replace(index + "_undefined", featureCounter.get(index + "_undefined") + 1);
}
}
}

LinkedHashMap<String, Integer> featureNameCounter = new LinkedHashMap<String, Integer>();

for (Map.Entry<String, Integer> entry : featureCounter.entrySet()) {
if (entry.getKey().contains("_selected")
&& booleanAssignmentList
.getVariableMap()
.get(Integer.valueOf(entry.getKey().replace("_selected", "")))
.isPresent()) {
featureNameCounter.put(
booleanAssignmentList
.getVariableMap()
.get(Integer.valueOf(entry.getKey().replace("_selected", "")))
.get()
+ "_selected",
entry.getValue());
} else if (entry.getKey().contains("_deselected")
&& booleanAssignmentList
.getVariableMap()
.get(Integer.valueOf(entry.getKey().replace("_deselected", "")))
.isPresent()) {
featureNameCounter.put(
booleanAssignmentList
.getVariableMap()
.get(Integer.valueOf(entry.getKey().replace("_deselected", "")))
.get()
+ "_deselected",
entry.getValue());
} else if (entry.getKey().contains("_undefined")
&& booleanAssignmentList
.getVariableMap()
.get(Integer.valueOf(entry.getKey().replace("_undefined", "")))
.isPresent()) {
featureNameCounter.put(
booleanAssignmentList
.getVariableMap()
.get(Integer.valueOf(entry.getKey().replace("_undefined", "")))
.get()
+ "_undefined",
entry.getValue());
}
}
return Result.of(featureNameCounter);
}
}
Loading