《ONE仿真》:
书本P161 P163
这两页都有关于时间产生器
Event1.hosts=0,199
Event2.hosts=200,,299
ONE时间产生器源码
* The lower bound is inclusive and upper bound exclusive. */
public static final String HOST_RANGE_S = "hosts";
/** (Optional) receiver address range -setting id ({@value}).
* If a value for this setting is defined, the destination hosts are
* selected from this range and the source hosts from the
* {@link #HOST_RANGE_S} setting's range.
* The lower bound is inclusive and upper bound exclusive. */
public static final String TO_HOST_RANGE_S = "tohosts";
也就是
[0,199) 下限包含,上限不包含 第199个节点并没有产生消息(下标从0开始)
[200,299) 第299个节点并没有产生消息(下标从0开始)
正确的配置应该是
Event1.hosts=0,200 [0,200) ---->0 1 ...199 =100个节点
Event2.hosts=200,300 [200,300) ----->200 201 202 ... 299 =100个节点