Optima Micro configuration
PTV Optima Micro requires a set of configuration involving the listed system files:
- /opt/ptv-optima-vv.n.xxxxptv-optima-as/standalone/configuration/optima/optima-configuration.xml.
- C:\optima\ptv-optima-micro\config-templates\ptv-optima-microSettings.xml
- C:\optima\ptv-optima-micro-monitor\config-templates\ptv-optima-micro-monitorSettings.xml
- C:\optima\ptv-optima-scenecleaner\config-templates\ptv-optima-SceneCleanerSettings.xml
Important: All parameters involving the definition of a file path must be set according to the values of $INSTALL_PATH and C:\optima.

Optima AS handles the communication with the backend components and provides the API for Optima Micro.
A fragment of the optima-configuration.xml related to the <optima-micro> tag:
<configurations>
....
<configuration name="optima" description="OPTIMA STANDARD INSTALLATION" disabled="false" icon="">
........
<optima-micro>
<fault-tolerance>
<!--
=========================================================================
parameters specified in seconds
=========================================================================
-->
<queueCleanupTimeout enabled="true">1800</queueCleanupTimeout>
<simulationTimeout>600</simulationTimeout>
</fault-tolerance>
<sendLinkResults>true</sendLinkResults>
<!--
=========================================================================
- on production env choose "Kafka" (remember to install optima-micro, kafka and zookeeper services)
- enable "Artemis" or "Kafkartemis" just for debugging purpose
=========================================================================
-->
<messageBrokerType>Kafka</messageBrokerType>
<kafka>
<!-- a list of host:port comma separated for the message-broker cluster -->
<kafkaCluster>messageBroker_1:9092,messageBroker_2:9092,messageBroker_3:9092</kafkaCluster>
<kafkaConsumerGroup>test-consumer-group</kafkaConsumerGroup>
<ConsumerPollTimeout>30000</ConsumerPollTimeout>
<consumerStartupDelay>30000</consumerStartupDelay>
<consumerDelay>1000</consumerDelay>
<!-- the Optima Micro Topic -->
<triggerTopic>optimissim-startsimulation</triggerTopic>
<resultTopic>optimissim-kpiresult</resultTopic>
<offlineTopic>optimissim-vissimofflinedataresult</offlineTopic>
<statusTopic>optimissim-statusupdate</statusTopic>
</kafka>
</optima-micro>
........
</configuration>
</configurations>
Important: With exception of the properties identified by queueCleanupTimeout, simulationTimeout, and kafkaCluster, all the other parameters should not be changed from their default settings.

These parameters are placed in the tag <configuration>/<optima-micro>/<fault-tolerance>.
Property |
Type |
Description |
---|---|---|
queueCleanupTimeout |
Integer |
Identifies (in seconds) the time period after which the simulations requests are flushed from the queue. The license feature Max_OptimaMicroScenarioSimulations specifies how many micro simulation parallel requests are allowed (the usual value is 4). If new micro simulation requests exceed this limit, and earlier requests are currently in progress, the new requests are stored into a waiting queue until the earlier requests finish. If the requests are in the queue for longer than the specifiec queueCleanupTimeout, they are discarded. Default value: 1800 (30 minutes) The only one parameter of the property is:
|
simulationTimeout |
Integer |
Identifies (in seconds) the time period after which the a micro-simulation requests is forcefully finished. Default value: 300 (5 minutes). This parameter keeps the system safe from simulations suddenly crashed. It must be large enough to easily complete typical simulations requests. If all different random seed micro simulations of a request fail to finish within time, then the simulation request is marked as FAILED_SIMULATION_TIMEOUT (see also <NumRandomSeeds> in → ptv-optima-microSettings.xml). |

This parameter is placed in the tag <configuration>/<optima-micro>/<kafka>.
Property |
Type |
Description |
---|---|---|
kafkaCluster |
String |
A comma separated list of hostname:port (or ip:port) of all servers of the message broker cluster. The port is specified into the properties of the Kafka Message Broker component. The default value is 9092. Example: <kafkaCluster>msgBroker_1:9092,msgBroker_2:9092, ... ,msgBroker_N:9092</kafkaCluster> |

Optima AS provides the TS GUI for Optima Micro.
You must update the optima-configuration.xml section related to the <TrafficSupervisor> tag.

In different areas of TS you can select an available simulation engine:
- real time
- micro
- planning
This property is managed through a specific section of the file optima-configuration.xml, according with this procedure:
-
Open the file:
/opt/ptv-optima-vv.n.xxxx/ptv-optima-as/standalone/configuration/optima/optima-configuration.xml.
-
Find the section:
<configuration>/<TrafficSupervisor>/<AppSettings>/<scenarioEvaluationMode>
-
If necessary, add the string associated to the simulation engine to be enabled into the array delimited by square brackets.
Example:
<appSettings> ..... <scenarioEvaluationMode>JSONCONF ["real time", "micro", "planning"] </scenarioEvaluationMode> ..... </appSettings>
- Save the file optima-configuration.xml.
For Optima Micro, in the step 3 set the string micro.

Optima Micro features in Traffic Supervisor are available through:
- The layers Scenario, Scenario Results, Micro Traffic Estimation, and Micro subnetworks (see → Scenarios layer).
- The SCENARIOS workspace (see → Scenario workspace).
You can enable the layers Scenario, Scenario Results, Micro Traffic Estimation, and Micro subnetworks and through the file optima-configuration.xml, according with this procedure:
-
Open the file:
/opt/ptv-optima-vv.n.xxxxptv-optima-as/standalone/configuration/optima/optima-configuration.xml.
-
Find the section:
<configuration>/<TrafficSupervisor>/<layers>/<Scenario>.
- Uncomment the entire section <Scenario>...</Scenario>.
-
Find the section:
<configuration>/<TrafficSupervisor>/<layers>/<ScenarioResults>
- Uncomment the entire section <ScenarioResults>...</ScenarioResults>.
-
Find the section:
<configuration>/<TrafficSupervisor>/<layers>/<MicroSubnetworks>
- Uncomment the entire section <MicroSubnetworks>...</MicroSubnetworks>.
-
Find the section:
<configuration>/<TrafficSupervisor>/<layers>/<MicroResults>
- Uncomment the entire section <MicroResults>...</MicroResults>.
- Save the file optima-configuration.xml.

The backend component ptv-optima-micro receives, prepares and executes micro-simulation requests from the Optima AS.
An example of the ptv-optima-microSettings.xml:
<Configuration>
<Kafka>
<!-- A comma separated list of hostname:port (or ip:port) of all servers of the message broker cluster -->
<BrokerList>%BrokerList%</BrokerList>
</Kafka>
<Status>
<!-- Interval at which a progress update is sent to Optima (mainly for progress counter) -->
<UpdateInterval>00:00:10</UpdateInterval>
</Status>
<Prepare>
<!-- Number of random seeds / Vissim simulations to use. This impacts the reliability of the results. 3-10 are recommended. -->
<NumRandomSeeds>3</NumRandomSeeds>
<!-- Vissim DTA interval in seconds. Most important: This is the time resolution when acting on link closures. -->
<VissimEvaluationInterval>300</VissimEvaluationInterval>
<!-- Number of warmup DTA intervals to run before the actual simulation starts. -->
<VissimNumWarmupEvaluationIntervals>1</VissimNumWarmupEvaluationIntervals>
<!-- Path to the prepared baseline network data. -->
<Vissim_Model>c:\optima\micro\Vissim_Model</Vissim_Model>
<!-- Timespan after which a new offline data generation is triggered. -->
<OfflineRetryTimeOut>00:01:00</OfflineRetryTimeOut>
</Prepare>
<!-- skip this xml-node if you don't want to simulate on this machine-->
<Simulate>
<!-- Should be same as Prepare/Vissim_Model -->
<Vissim_Model>c:\optima\micro\Vissim_Model</Vissim_Model>
<!-- Folder where temporary data is copied to (Vissim network to simulate) -->
<WorkingFolder>c:\optima\micro\WorkingDirectory</WorkingFolder>
<!-- COM Id of the Vissim to use. You _could_ use, e.g., Vissim.Vissim1100 or so if multiple Vissims are installed. -->
<VissimProgId>Vissim.Vissim</VissimProgId>
<!-- How many simulations this node can do in parallel -->
<NumParallelWorkers>3</NumParallelWorkers>
</Simulate>
<!-- You can enable/disable functionality in individual nodes with this tags or by omitting the Prepare, Status, or Simulate tags. -->
<CanAggregate>true</CanAggregate>
<CanOffline>true</CanOffline>
<!-- Messages older than that value are not read on startup, and may be discarded from the state copy that the service keeps.
Should be considerably larger than the request timeout. Hardcoded default if not set is 30 minutes. -->
<MessageRetentionTimeSpan>00:30:00</MessageRetentionTimeSpan>
<Logging>
<!-- Output file for the logging. -->
<PathFormat>c:\optima\micro\log\ptv-optima-micro-{Date}.txt</PathFormat>
<!-- If this tag exists and a valid broker list is set, all log messages will also be sent to the corresponding Kafka. -->
<Kafka>
<BrokerList>%BrokerList%</BrokerList>
</Kafka>
</Logging>
<!-- testing -->
</Configuration>

The backend component ptv-optima-micro-monitor allows to collect and save log messages from ptv-optima-micro components which are installed on distributed servers.
Important: This is a debugging tool and not suitable for 24 hours x 7 days operations.
An example of the ptv-optima-micro-monitorSettings.xml:
<Configuration>
<Kafka>
<!-- A comma separated list of hostname:port (or ip:port) of all servers of the message broker cluster -->
<BrokerList>%BrokerList%</BrokerList>
<!-- "End": read starts with new log messages, "Begin": reads all log messages -->
<Offset>End</Offset>
</Kafka>
<Logging>
<!-- Output file for the logging. -->
<PathFormat>c:\optima\micro\log\ptv-optima-micro-monitor-{Date}.txt</PathFormat>
</Logging>
</Configuration>

The backend component ptv-optima-scenecleaner cleans log and temporary files.
An example of the ptv-optima-SceneCleanerSettings.xml:
<Configuration>
<FoldersToClean>
<!-- One entry for each folder that should be purged periodically. -->
<FolderToClean>
<!-- Folder that is cleaned. -->
<Folder>c:\optima\micro\WorkingDirectory</Folder>
<!-- clean all files that are older than this value in days. -->
<BestBeforeEndInDays>3</BestBeforeEndInDays>
<!-- Comma-separated list of daytimes when to run the clean job. Default is 1 a.m.
Note that the job also runs immediately after startup. -->
<TimesEachDay>01:00:00</TimesEachDay>
</FolderToClean>
<FolderToClean>
<Folder>c:\optima\micro\Log</Folder>
<BestBeforeEndInDays>21</BestBeforeEndInDays>
<TimesEachDay>01:00:00</TimesEachDay>
</FolderToClean>
</FoldersToClean>
<Logging>
<PathFormat>c:\optima\micro\Log\SceneCleaner-{Date}.txt</PathFormat>
<!-- If this tag and the broker list are set, log messages are sent to the Kafka log -->
<Kafka>
<!-- A comma separated list of hostname:port (or ip:port) of all servers of the message broker cluster -->
<BrokerList>%BrokerList%</BrokerList>
</Kafka>
</Logging>
</Configuration>