MLF-STF communication
MLF can be used in combination with the PTV Optima Short-Term Forecast (STF) module, feeding the latter with its measure predictions, greatly enhancing the forecast quality of the simulation-based approach.
In this case is necessary to enable the communication between STF and MLF, acting on CommandlineTDE.csv file.

In the CommandlineTDE.csv it's necessary to set the datasource DS_TSTA_FORECAST:
DS_TSTA_FORECAST
webservice:https://<apache-load-balancer-ip-address>
It's not necessary to specify the port.

You can consider a configuration for:
-
Two application servers: AS1 and AS2
-
Three servers hosting Machine Learning Forecast (MLF): MLF1, MLF2, and MLF3
-
The node hosting Apache: Proxy1.
<VirtualHost _default_:443>
# SSL configurations, can vary depending on the actual setup
SSLEngine on
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile "${SRVROOT}/conf/certificate.crt"
SSLCertificateKeyFile "${SRVROOT}/conf/privateKey.key"
# end SSL configurations
RewriteEngine On
ProxyPreserveHost On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) wss://as1:8443/$1 [P,L]
# managing MLF traffic
<Proxy "balancer://mlf-api-processing-api">
ProxySet lbmethod=bybusyness
BalancerMember "https://mlf1/mlf-api-processing-api"
BalancerMember "https://mlf2/mlf-api-processing-api"
BalancerMember "https://mlf3/mlf-api-processing-api"
</Proxy>
<Proxy "balancer://mlf-forecast-results-processing-api">
ProxySet lbmethod=bybusyness
BalancerMember "https://mlf1/mlf-forecast-results-processing-api"
BalancerMember "https://mlf2/mlf-forecast-results-processing-api"
BalancerMember "https://mlf3/mlf-forecast-results-processing-api"
</Proxy>
ProxyPass /ml-forecast/ "balancer://mlf-api-processing-api/"
ProxyPassReverse /ml-forecast/ "balancer://mlf-api-processing-api/"
ProxyPass /statistical-forecast-ws/ "balancer://mlf-forecast-results-processing-api">
ProxyPassReverse /statistical-forecast-ws/ "balancer://mlf-forecast-results-processing-api">
# end MLF management
</VirtualHost>