|
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 |
0 commit comments