如何在一个模拟器中关闭节点接口

时间:2019-04-02 04:38:55

标签: java question-answering one-simulator

我想关闭节点的移动和接口,在这里我使用activeTime = 0,1800,25000,42300设置,移动无效,但接口处于活动状态。我该怎么办?设置部分是否缺少某些内容?或如何?你能给我一些线索吗?

此处是代码

public boolean isActive() {
    boolean active;

    if (ah == null) {
        return true; /* no handler: always active */
    }

    active = ah.isActive(this.activenessJitterValue);

    if (active && host.getComBus().getDouble(EnergyModel.ENERGY_VALUE_ID,
                1) <= 0) {
        /* TODO: better way to check battery level */
        /* no battery -> inactive */
        active = false;
    }

    if (active == false && this.transmitRange > 0) {
        /* not active -> make range 0 */
        this.oldTransmitRange = this.transmitRange;
        host.getComBus().updateProperty(RANGE_ID, 0.0);
                    System.out.println("tuyul");
    } else if (active == true && this.transmitRange == 0.0) {
        /* active, but range == 0 -> restore range  */
        host.getComBus().updateProperty(RANGE_ID, 
                this.oldTransmitRange);
    }   
    return active;
}

问题是“活动”,始终被视为True,永不为假

0 个答案:

没有答案