Skip to content

Commit 26a4ccd

Browse files
committed
Migrated from hiconfit-core
1 parent 2221ca2 commit 26a4ccd

15 files changed

Lines changed: 1824 additions & 2 deletions

File tree

README.md

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,88 @@
1-
# KBStatistics
2-
A Knowledge Base Statistics Tool
1+
# KBStatistics - A Knowledge Base Statistics Tool
2+
3+
| *version* | *status* |
4+
|-----------------------------------------------------------------------------------|----------|
5+
| [1.3.1](https://github.com/manleviet/CA-CDR-V2/releases/tag/kbstatistics-v1.3.1) | latest |
6+
7+
`kbstatistics` is a Java `jar` tool that calculates statistics of given knowledge bases.
8+
9+
### Features
10+
11+
The tool analysis and prints out the following statistics of given knowledge bases:
12+
13+
1. **General statistics** (for all types of knowledge base)
14+
- The knowledge base name
15+
- The knowledge base source
16+
- Number of variables
17+
- Number of constraints
18+
- Number of Choco variables
19+
- Number of Choco constraints
20+
- The consistency of the knowledge base
21+
22+
2. **Statistics for feature model**
23+
- The CTC ratio
24+
- The number of features
25+
- The number of relationships
26+
- The number of cross-tree constraints
27+
- The number of MANDATORY relationships
28+
- The number of OPTIONAL relationships
29+
- The number of ALTERNATIVE relationships
30+
- The number of OR relationships
31+
- The number of REQUIRES constraints
32+
- The number of EXCLUDES constraints
33+
34+
## Supported knowledge bases
35+
36+
- _Feature models_ from [SPLOT], [FeatureIDE], [Glencoe], and other tools. You can find some feature model examples in [here].
37+
- _PC_, _Renault_, and _Camera_ from [CLib].
38+
39+
## Usage
40+
41+
**Download**: [Latest (v1.3.1)]{: .label .label-green }
42+
43+
**Requirements**: [Latest Java]{: .label .label-green }
44+
45+
**Syntax**:
46+
```bash
47+
java -jar kbstatistics.jar [-h] [-kb <PC>|<Renault>|<Camera>] [-fm <feature_model_name>] [-fm-dir <path_to_folder>] [-out <path_to_file>]
48+
```
49+
50+
If the parameter `-out` isn't specified, the statistics results will be saved in the file `statistics.txt`.
51+
52+
**Examples**:
53+
- Print out the help
54+
```bash
55+
java -jar kbstatistics.jar -h
56+
```
57+
- Saving the statistics of the _PC_ knowledge base on the default file (`statistics.txt`)
58+
```bash
59+
java -jar kbstatistics.jar -kb PC
60+
```
61+
- Saving the statistics of the _PC_ knowledge base on `pc_results.txt `
62+
```bash
63+
java -jar kbstatistics.jar -kb PC -out ./pc_results.txt
64+
```
65+
- Saving the statistics of the _PC_ and _Renault_ knowledge bases on the default file (`statistics.txt`)
66+
```bash
67+
java -jar kbstatistics.jar -kb PC Renault
68+
```
69+
- Saving the statistics of the smartwatch feature model on the default file (`statistics.txt`)
70+
```bash
71+
java -jar kbstatistics.jar -fm smartwatch.sxfm
72+
```
73+
- Saving the statistics of feature models in the folder `fms` on the default file (`statistics.txt`)
74+
```bash
75+
java -jar kbstatistics.jar -fm-dir ./fms
76+
```
77+
- Saving the statistics of _PC_, _Renault_, and feature models in the folder `fms` on the default file (`statistics.txt`)
78+
```bash
79+
java -jar kbstatistics.jar -fm-dir ./fms -kb PC Renault
80+
```
81+
82+
[Latest (V1.3.1)]: https://github.com/manleviet/CA-CDR-V2/releases/tag/kbstatistics-v1.3.1
83+
[SPLOT]: http://www.splot-research.org
84+
[CLib]: https://www.itu.dk/research/cla/externals/clib/
85+
[FeatureIDE]: https://featureide.github.io
86+
[Glencoe]: https://glencoe.hochschule-trier.de
87+
[here]: https://github.com/manleviet/KBStatistics/tree/main/src/test/resources/fms
88+
[Latest Java]: https://www.java.com/en/download/manual.jsp

pom.xml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ KBStatistics - A Knowledge Base Statistics Tool
4+
~
5+
~ Copyright (c) 2023
6+
~
7+
~ @author: Viet-Man Le (vietman.le@ist.tugraz.at)
8+
-->
9+
10+
<project xmlns="http://maven.apache.org/POM/4.0.0"
11+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
13+
<modelVersion>4.0.0</modelVersion>
14+
15+
<groupId>at.tugraz.ist.ase.hiconfit</groupId>
16+
<artifactId>kbstatistics</artifactId>
17+
<version>1.3.1</version>
18+
<packaging>jar</packaging>
19+
20+
<properties>
21+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
22+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
23+
<maven.compiler.source>20</maven.compiler.source>
24+
<maven.compiler.target>20</maven.compiler.target>
25+
<artifact.version>0.1.1-alpha-04</artifact.version>
26+
</properties>
27+
28+
<profiles>
29+
<profile>
30+
<id>github-maven-repository</id>
31+
<repositories>
32+
<repository>
33+
<id>github-maven-repository</id>
34+
<url>https://maven.pkg.github.com/HiConfiT/*</url>
35+
</repository>
36+
</repositories>
37+
</profile>
38+
</profiles>
39+
40+
<dependencies>
41+
<!--suppress VulnerableLibrariesLocal -->
42+
<dependency>
43+
<groupId>at.tugraz.ist.ase.hiconfit</groupId>
44+
<artifactId>kb</artifactId>
45+
<version>${artifact.version}</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>ch.qos.logback</groupId>
50+
<artifactId>logback-classic</artifactId>
51+
<version>1.4.6</version>
52+
<scope>test</scope>
53+
<exclusions>
54+
<exclusion> <!-- declare the exclusion here -->
55+
<groupId>org.slf4j</groupId>
56+
<artifactId>slf4j-api</artifactId>
57+
</exclusion>
58+
</exclusions>
59+
</dependency>
60+
</dependencies>
61+
62+
<build>
63+
<plugins>
64+
<plugin>
65+
<groupId>org.apache.maven.plugins</groupId>
66+
<artifactId>maven-surefire-plugin</artifactId>
67+
<version>2.22.0</version>
68+
</plugin>
69+
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-compiler-plugin</artifactId>
73+
<version>3.8.1</version>
74+
<configuration>
75+
<source>${maven.compiler.source}</source>
76+
<target>${maven.compiler.target}</target>
77+
</configuration>
78+
</plugin>
79+
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-assembly-plugin</artifactId>
83+
<version>3.3.0</version>
84+
<executions>
85+
<execution>
86+
<phase>package</phase>
87+
<goals>
88+
<goal>single</goal>
89+
</goals>
90+
<configuration>
91+
<archive>
92+
<manifest>
93+
<mainClass>
94+
at.tugraz.ist.ase.hiconfit.KBStatistics
95+
</mainClass>
96+
</manifest>
97+
</archive>
98+
<descriptorRefs>
99+
<descriptorRef>jar-with-dependencies</descriptorRef>
100+
</descriptorRefs>
101+
</configuration>
102+
</execution>
103+
</executions>
104+
</plugin>
105+
</plugins>
106+
</build>
107+
108+
<developers>
109+
<developer>
110+
<id>manleviet</id>
111+
<name>Viet-Man Le</name>
112+
<email>vietman.le@ist.tugraz.at</email>
113+
<url>https://github.com/manleviet</url>
114+
</developer>
115+
</developers>
116+
117+
</project>

0 commit comments

Comments
 (0)