Merge branch 'main' into combined-prs-branch
[e-mobility-charging-stations-simulator.git] / README.md
index bf3fab5f1d4491db01b31ddab74079900ddd4483..dcb4a23c408c96987cb40bde4db789ea23a1db3c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,10 +2,11 @@
 
 # [e-mobility charging stations simulator](https://github.com/sap/e-mobility-charging-stations-simulator)
 
-[![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=https://gist.githubusercontent.com/jerome-benoit/c7c669b881d5b27dc0b44a639504ff93/raw/clone.json&logo=github)](https://github.com/SAP/e-mobility-charging-stations-simulator/graphs/traffic)
-[![GitHub commit activity (main)](https://img.shields.io/github/commit-activity/m/SAP/e-mobility-charging-stations-simulator/main)](https://github.com/SAP/e-mobility-charging-stations-simulator/graphs/commit-activity)
+[![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Clone&query=count&url=https://gist.githubusercontent.com/jerome-benoit/c7c669b881d5b27dc0b44a639504ff93/raw/clone.json&logo=github)](https://github.com/SAP/e-mobility-charging-stations-simulator/graphs/traffic)
+[![GitHub commit activity (main)](https://img.shields.io/github/commit-activity/m/SAP/e-mobility-charging-stations-simulator/main?color=brightgreen&logo=github)](https://github.com/SAP/e-mobility-charging-stations-simulator/graphs/commit-activity)
 [![CI workflow](https://github.com/SAP/e-mobility-charging-stations-simulator/actions/workflows/ci.yml/badge.svg)](https://github.com/SAP/e-mobility-charging-stations-simulator/actions/workflows/ci.yml)
 [![REUSE status](https://api.reuse.software/badge/github.com/SAP/e-mobility-charging-stations-simulator)](https://api.reuse.software/info/github.com/SAP/e-mobility-charging-stations-simulator)
+[![Javascript Standard Style Guide](<https://badgen.net/static/code style/standard/green>)](https://standardjs.com)
 
 ## Summary
 
@@ -33,7 +34,7 @@ brew install node
 
 ### GNU/Linux
 
-- [NodeSource](https://github.com/nodesource/distributions) Node.js Binary Distributions for version >= 16.X
+- [NodeSource](https://github.com/nodesource/distributions) Node.js Binary Distributions for all supported versions.
 
 ## Installation
 
@@ -100,26 +101,26 @@ But the modifications to test have to be done to the files in the build target d
 
 **src/assets/config.json**:
 
-| Key                        | Value(s)                                     | Default Value                                                                                                                                                                                                                 | Value type                                                                                                                                                                                                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
-| -------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| supervisionUrls            |                                              | []                                                                                                                                                                                                                            | string \| string[]                                                                                                                                                                                                                                                       | string or strings array containing global connection URIs to OCPP-J servers                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
-| supervisionUrlDistribution | round-robin/random/charging-station-affinity | charging-station-affinity                                                                                                                                                                                                     | string                                                                                                                                                                                                                                                                   | supervision urls distribution policy to simulated charging stations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
-| log                        |                                              | {<br />"enabled": true,<br />"file": "logs/combined.log",<br />"errorFile": "logs/error.log",<br />"statisticsInterval": 60,<br />"level": "info",<br />"console": false,<br />"format": "simple",<br />"rotate": true<br />} | {<br />enabled: boolean;<br />file: string;<br />errorFile: string;<br />statisticsInterval: number;<br />level: string;<br />console: boolean;<br />format: string;<br />rotate: boolean;<br />maxFiles: string \| number;<br />maxSize: string \| number;<br />}       | Log configuration section:<br />- _enabled_: enable logging<br />- _file_: log file relative path<br />- _errorFile_: error log file relative path<br />- _statisticsInterval_: seconds between charging stations statistics output in the logs<br />- _level_: emerg/alert/crit/error/warning/notice/info/debug [winston](https://github.com/winstonjs/winston) logging level</br >- _console_: output logs on the console<br />- _format_: [winston](https://github.com/winstonjs/winston) log format<br />- _rotate_: enable daily log files rotation<br />- _maxFiles_: maximum number of log files: https://github.com/winstonjs/winston-daily-rotate-file#options<br />- _maxSize_: maximum size of log files in bytes, or units of kb, mb, and gb: https://github.com/winstonjs/winston-daily-rotate-file#options |
-| worker                     |                                              | {<br />"processType": "workerSet",<br />"startDelay": 500,<br />"elementStartDelay": 0,<br />"elementsPerWorker": 'auto',<br />"poolMinSize": 4,<br />"poolMaxSize": 16<br />}                                                | {<br />processType: WorkerProcessType;<br />startDelay: number;<br />elementStartDelay: number;<br />elementsPerWorker: number \| 'auto';<br />poolMinSize: number;<br />poolMaxSize: number;<br />}                                                                     | Worker configuration section:<br />- _processType_: worker threads process type (`workerSet`/`staticPool`/`dynamicPool`)<br />- _startDelay_: milliseconds to wait at worker threads startup (only for `workerSet` worker threads process type)<br />- _elementStartDelay_: milliseconds to wait at charging station startup<br />- _elementsPerWorker_: number of charging stations per worker threads for the `workerSet` process type (`auto` means (number of stations) / (number of CPUs) \* 1.5 if (number of stations) > (number of CPUs), otherwise 1)<br />- _poolMinSize_: worker threads pool minimum number of threads</br >- _poolMaxSize_: worker threads pool maximum number of threads                                                                                                                   |
-| uiServer                   |                                              | {<br />"enabled": false,<br />"type": "ws",<br />"version": "1.1",<br />"options": {<br />"host": "localhost",<br />"port": 8080<br />}<br />}                                                                                | {<br />enabled: boolean;<br />type: ApplicationProtocol;<br />version: ApplicationProtocolVersion;<br />options: ServerOptions;<br />authentication: {<br />enabled: boolean;<br />type: AuthenticationType;<br />username: string;<br />password: string;<br />}<br />} | UI server configuration section:<br />- _enabled_: enable UI server<br />- _type_: 'http' or 'ws'<br />- _version_: '1.1' or '2.0'<br />- _options_: node.js net module [listen options](https://nodejs.org/api/net.html#serverlistenoptions-callback)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
-| performanceStorage         |                                              | {<br />"enabled": false,<br />"type": "jsonfile",<br />"uri": "file:///performance/performanceRecords.json"<br />}                                                                                                            | {<br />enabled: boolean;<br />type: string;<br />uri: string;<br />}                                                                                                                                                                                                     | Performance storage configuration section:<br />- _enabled_: enable performance storage<br />- _type_: 'jsonfile' or 'mongodb'<br />- _uri_: storage relative URI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
-| stationTemplateUrls        |                                              | {}[]                                                                                                                                                                                                                          | {<br />file: string;<br />numberOfStations: number;<br />}[]                                                                                                                                                                                                             | array of charging station configuration templates URIs configuration section (charging station configuration template file name and number of stations)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
+| Key                        | Value(s)                                     | Default Value                                                                                                                                                                                                                 | Value type                                                                                                                                                                                                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
+| -------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| supervisionUrls            |                                              | []                                                                                                                                                                                                                            | string \| string[]                                                                                                                                                                                                                                                       | string or strings array containing global connection URIs to OCPP-J servers                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
+| supervisionUrlDistribution | round-robin/random/charging-station-affinity | charging-station-affinity                                                                                                                                                                                                     | string                                                                                                                                                                                                                                                                   | supervision urls distribution policy to simulated charging stations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
+| log                        |                                              | {<br />"enabled": true,<br />"file": "logs/combined.log",<br />"errorFile": "logs/error.log",<br />"statisticsInterval": 60,<br />"level": "info",<br />"console": false,<br />"format": "simple",<br />"rotate": true<br />} | {<br />enabled: boolean;<br />file: string;<br />errorFile: string;<br />statisticsInterval: number;<br />level: string;<br />console: boolean;<br />format: string;<br />rotate: boolean;<br />maxFiles: string \| number;<br />maxSize: string \| number;<br />}       | Log configuration section:<br />- _enabled_: enable logging<br />- _file_: log file relative path<br />- _errorFile_: error log file relative path<br />- _statisticsInterval_: seconds between charging stations statistics output in the logs<br />- _level_: emerg/alert/crit/error/warning/notice/info/debug [winston](https://github.com/winstonjs/winston) logging level</br >- _console_: output logs on the console<br />- _format_: [winston](https://github.com/winstonjs/winston) log format<br />- _rotate_: enable daily log files rotation<br />- _maxFiles_: maximum number of log files: https://github.com/winstonjs/winston-daily-rotate-file#options<br />- _maxSize_: maximum size of log files in bytes, or units of kb, mb, and gb: https://github.com/winstonjs/winston-daily-rotate-file#options                                                                                         |
+| worker                     |                                              | {<br />"processType": "workerSet",<br />"startDelay": 500,<br />"elementStartDelay": 0,<br />"elementsPerWorker": 'auto',<br />"poolMinSize": 4,<br />"poolMaxSize": 16<br />}                                                | {<br />processType: WorkerProcessType;<br />startDelay: number;<br />elementStartDelay: number;<br />elementsPerWorker: number \| 'auto' \| 'all';<br />poolMinSize: number;<br />poolMaxSize: number;<br />}                                                            | Worker configuration section:<br />- _processType_: worker threads process type (`workerSet`/`fixedPool`/`dynamicPool`)<br />- _startDelay_: milliseconds to wait at worker threads startup (only for `workerSet` worker threads process type)<br />- _elementStartDelay_: milliseconds to wait at charging station startup<br />- _elementsPerWorker_: number of charging stations per worker threads for the `workerSet` process type (`auto` means (number of stations) / (number of CPUs) \* 1.5 if (number of stations) > (number of CPUs), otherwise 1; `all` means a unique worker will run all charging stations)<br />- _poolMinSize_: worker threads pool minimum number of threads</br >- _poolMaxSize_: worker threads pool maximum number of threads<br />- _resourceLimits_: worker threads [resource limits](https://nodejs.org/api/worker_threads.html#new-workerfilename-options) object option |
+| uiServer                   |                                              | {<br />"enabled": false,<br />"type": "ws",<br />"version": "1.1",<br />"options": {<br />"host": "localhost",<br />"port": 8080<br />}<br />}                                                                                | {<br />enabled: boolean;<br />type: ApplicationProtocol;<br />version: ApplicationProtocolVersion;<br />options: ServerOptions;<br />authentication: {<br />enabled: boolean;<br />type: AuthenticationType;<br />username: string;<br />password: string;<br />}<br />} | UI server configuration section:<br />- _enabled_: enable UI server<br />- _type_: 'http' or 'ws'<br />- _version_: HTTP version '1.1' or '2.0'<br />- _options_: node.js net module [listen options](https://nodejs.org/api/net.html#serverlistenoptions-callback)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
+| performanceStorage         |                                              | {<br />"enabled": false,<br />"type": "jsonfile",<br />"uri": "file:///performance/performanceRecords.json"<br />}                                                                                                            | {<br />enabled: boolean;<br />type: string;<br />uri: string;<br />}                                                                                                                                                                                                     | Performance storage configuration section:<br />- _enabled_: enable performance storage<br />- _type_: 'jsonfile' or 'mongodb'<br />- _uri_: storage URI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
+| stationTemplateUrls        |                                              | {}[]                                                                                                                                                                                                                          | {<br />file: string;<br />numberOfStations: number;<br />}[]                                                                                                                                                                                                             | array of charging station configuration templates URIs configuration section (charging station configuration template file name and number of stations)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
 
 #### Worker process model
 
 - **workerSet**:
-  Worker set executing each a static number (elementsPerWorker) of simulated charging stations from the total
+  Worker set executing each a fixed number (elementsPerWorker) of simulated charging stations from the total
 
-- **staticPool**:
-  Statically sized worker pool executing a static total number of simulated charging stations
+- **fixedPool**:
+  Fixedly sized worker pool executing a fixed total number of simulated charging stations
 
 - **dynamicPool** (experimental):
-  Dynamically sized worker pool executing a static total number of simulated charging stations
+  Dynamically sized worker pool executing a fixed total number of simulated charging stations
 
 ### Charging station configuration template
 
@@ -166,11 +167,12 @@ But the modifications to test have to be done to the files in the build target d
 | amperageLimitationOcppKey                            |               | undefined                                                                                                                          | string                                                                                                                                                                   | charging stations OCPP parameter key used to set the amperage limit, per phase for each connector on AC and global for DC                                                                                                                  |
 | amperageLimitationUnit                               | A/cA/dA/mA    | A                                                                                                                                  | string                                                                                                                                                                   | charging stations amperage limit unit                                                                                                                                                                                                      |
 | enableStatistics                                     | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | enable charging stations statistics                                                                                                                                                                                                        |
-| mustAuthorizeAtRemoteStart                           | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | always send authorize at remote start transaction when AuthorizeRemoteTxRequests is enabled                                                                                                                                                |
+| remoteAuthorization                                  | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable RFID tags remote authorization                                                                                                                                                                                                      |
 | beginEndMeterValues                                  | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | enable Transaction.{Begin,End} MeterValues                                                                                                                                                                                                 |
 | outOfOrderEndMeterValues                             | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | send Transaction.End MeterValues out of order. Need to relax OCPP specifications strict compliance ('ocppStrictCompliance' parameter)                                                                                                      |
 | meteringPerTransaction                               | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable metering history on a per transaction basis                                                                                                                                                                                         |
 | transactionDataMeterValues                           | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | enable transaction data MeterValues at stop transaction                                                                                                                                                                                    |
+| stopTransactionsOnStopped                            | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable stop transactions on charging station stop                                                                                                                                                                                          |
 | mainVoltageMeterValues                               | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | include charging stations main voltage MeterValues on three phased charging stations                                                                                                                                                       |
 | phaseLineToLineVoltageMeterValues                    | true/false    | false                                                                                                                              | boolean                                                                                                                                                                  | include charging stations line to line voltage MeterValues on three phased charging stations                                                                                                                                               |
 | customValueLimitationMeterValues                     | true/false    | true                                                                                                                               | boolean                                                                                                                                                                  | enable limitation on custom fluctuated value in MeterValues                                                                                                                                                                                |
@@ -214,17 +216,18 @@ But the modifications to test have to be done to the files in the build target d
 
 ```ts
 type AutomaticTransactionGeneratorConfiguration = {
-  enable: boolean;
-  minDuration: number;
-  maxDuration: number;
-  minDelayBetweenTwoTransactions: number;
-  maxDelayBetweenTwoTransactions: number;
-  probabilityOfStart: number;
-  stopAfterHours: number;
-  stopOnConnectionFailure: boolean;
-  requireAuthorize?: boolean;
-  idTagDistribution?: 'random' | 'round-robin' | 'connector-affinity';
-};
+  enable: boolean
+  minDuration: number
+  maxDuration: number
+  minDelayBetweenTwoTransactions: number
+  maxDelayBetweenTwoTransactions: number
+  probabilityOfStart: number
+  stopAfterHours: number
+  stopAbsoluteDuration: boolean
+  stopOnConnectionFailure: boolean
+  requireAuthorize?: boolean
+  idTagDistribution?: 'random' | 'round-robin' | 'connector-affinity'
+}
 ```
 
 ##### Example:
@@ -328,25 +331,47 @@ The charging station configuration file content can be regenerated partially on
 
 The syntax is similar to charging station configuration template with some added fields like the charging station id (name) and the 'Configuration' section removed.
 
-#### configurationKey section
+That section is overwritten on matching charging station configuration template file changes.
 
-The syntax is similar to the charging station configuration template 'Configuration' section.
+#### connectorsStatus section
+
+The syntax is similar to charging station configuration template 'Connectors' section with some added fields.
+
+That section is overwritten on matching charging station configuration template file changes.
+
+#### evsesStatus section
+
+The syntax is similar to charging station configuration template 'Evses' section with some added fields.
+
+That section is overwritten on matching charging station configuration template file changes.
 
 #### automaticTransactionGenerator section
 
 The syntax is similar to the charging station configuration template 'AutomaticTransactionGenerator' section.
 
+That section is overwritten on matching charging station configuration template file changes.
+
+#### automaticTransactionGeneratorStatuses section
+
+That section is not overwritten on matching charging station configuration template file changes.
+
+#### configurationKey section
+
+The syntax is similar to the charging station configuration template 'Configuration' section.
+
+That section is not overwritten on matching charging station configuration template file changes.
+
 ## Docker
 
 In the [docker](./docker) folder:
 
-```bash
+```shell
 make
 ```
 
 <!-- Or with the optional git submodules:
 
-```bash
+```shell
 make SUBMODULES_INIT=true
 ``` -->
 
@@ -735,4 +760,4 @@ We as members, contributors, and leaders pledge to make participation in our com
 
 ## Licensing
 
-Copyright 2020-2023 SAP SE or an SAP affiliate company and e-mobility-charging-stations-simulator contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/e-mobility-charging-stations-simulator).
+Copyright 2020-2024 SAP SE or an SAP affiliate company and e-mobility-charging-stations-simulator contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/e-mobility-charging-stations-simulator).