Skip to content

Commit feb86da

Browse files
authored
Merge pull request #392 from capocchi/version-5.1
Version 5.1
2 parents e01fcc7 + f721b9d commit feb86da

File tree

8 files changed

+690
-881
lines changed

8 files changed

+690
-881
lines changed

devsimpy/DEVSKernel/BrokerDEVS/DEVSStreaming/SimStrategyMqttMS4Me.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def _simulate_for_ms4me(self, T=1e8):
498498
while self.ts.Get() < T and not self._simulator.end_flag:
499499
iteration += 1
500500

501-
if tmin == float("inf"):
501+
if tmin == INFINITY:
502502
logger.info("No more events - simulation complete")
503503
break
504504
if tmin > T:
@@ -660,7 +660,7 @@ def _simulate_for_ms4me(self, T=1e8):
660660
for model in self._atomic_models:
661661
if model not in td_int and model not in td_ext:
662662
all_next_times.append(model.timeNext)
663-
tmin = min(all_next_times) if all_next_times else float("inf")
663+
tmin = min(all_next_times) if all_next_times else INFINITY
664664

665665
# Update progress
666666
cpu_time = time.time() - t_start

devsimpy/DEVSKernel/BrokerDEVS/simulation_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def _get_default_port(broker_type: str) -> int:
217217

218218

219219
def auto_configure_simulation(
220-
standard: str = "ms4me",
220+
standard: str = "devs-streaming",
221221
broker: Optional[str] = None,
222222
host: Optional[str] = None,
223223
port: Optional[int] = None,
@@ -227,7 +227,7 @@ def auto_configure_simulation(
227227
Auto-configure simulation with sensible defaults.
228228
229229
Args:
230-
standard: Message standard to use (default: ms4me)
230+
standard: Message standard to use (default: devs-streaming)
231231
broker: Broker type (kafka, mqtt, rabbitmq)
232232
host: Broker host
233233
port: Broker port
@@ -245,7 +245,7 @@ def auto_configure_simulation(
245245
246246
# Fully manual
247247
config = auto_configure_simulation(
248-
standard='ms4me',
248+
standard='devs-streaming',
249249
broker='mqtt',
250250
host='broker.example.com',
251251
port=1883

devsimpy/Menu.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ def __init__(self, shape, event):
10111011
disable=wx.MenuItem(self, ID_DISABLE_SHAPE, _("Disable"), _("Disable the link for the simulation"))
10121012
export=wx.MenuItem(self, ID_EXPORT_SHAPE, _("Export"), _("Export the model"))
10131013
exportAMD=wx.MenuItem(self, ID_EXPORT_AMD_SHAPE, _("AMD"), _("Model exported to a amd file"))
1014-
exportKAFKA_WORKER=wx.MenuItem(self, ID_EXPORT_KAFKA_WORKER_PKG, _("Kafka Worker"), _("Model exported as a standalone package runnable with a Kafka-based simulator."))
1014+
exportKAFKA_WORKER=wx.MenuItem(self, ID_EXPORT_KAFKA_WORKER_PKG, _("Broker Worker"), _("Model exported as a standalone package runnable with a Kafka-based simulator."))
10151015
exportCMD=wx.MenuItem(self, ID_EXPORT_CMD_SHAPE, _("CMD"), _("Model exported to a cmd file"))
10161016
exportXML=wx.MenuItem(self, ID_EXPORT_XML_SHAPE, _("XML"), _("Model exported to a xml file"))
10171017
exportJS=wx.MenuItem(self, ID_EXPORT_JS_SHAPE, _("JS"), _("Model exported to a js (join) file"))
@@ -1148,15 +1148,22 @@ def __init__(self, shape, event):
11481148
if isinstance(shape, Container.CodeBlock):
11491149
AppendMenu(self, -1, _("Export"), export_subMenu)
11501150
Export_SubMenu1 = export_subMenu.Append(exportAMD)
1151+
Export_SubMenu2 = export_subMenu.Append(exportKAFKA_WORKER)
11511152
self.AppendSeparator()
11521153

1153-
if DEFAULT_DEVS_DIRNAME == "BrokerDEVS":
1154-
print("eeee")
1155-
if shape.isPY():
1156-
### TODO : impelmented but not tested for AMD model
1157-
Export_SubMenu2 = export_subMenu.Append(exportKAFKA_WORKER)
1158-
1159-
if shape.isPYC():
1154+
1155+
if shape.isPY():
1156+
if DEFAULT_DEVS_DIRNAME != "BrokerDEVS":
1157+
Export_SubMenu2.Enable(False)
1158+
1159+
elif shape.isAMD():
1160+
if DEFAULT_DEVS_DIRNAME != "BrokerDEVS":
1161+
Export_SubMenu2.Enable(False)
1162+
else:
1163+
### TODO: need to be implemented
1164+
Export_SubMenu2.Enable(False)
1165+
1166+
elif shape.isPYC():
11601167
Export_SubMenu1.Enable(False)
11611168

11621169

0 commit comments

Comments
 (0)