更改状态图中不同状态的源块属性

Changing properties of source block for different states in a statechart

我在 Main 中有一个如下所示的模型:

源块的到达间隔时间设置为统一 (4,8) 小时。

  1. 当状态图从“normalWeather”变为“storm”时,我希望 source 停止注入
  2. 当状态图从“暴风雨”变为“正常天气”时,我希望到达间隔时间回到统一的 (4,8) 小时。

这个问题的合适解决方案是什么?

设置要注入的源块而不是到达间隔时间。然后添加类型为 timeout 的转换,从 normalWeather 状态到自身。将超时设置为:

uniform(4,8)

并将操作设置为:

source.inject();

这样,只要您的代理处于正常天气状态,代理注入就会按照您想要的速率进行。