您如何计算节点或区域内的行人数量?

时间:2019-07-02 19:20:16

标签: anylogic

我已经使用此处显示的上一篇文章中的方法成功地计算了坐标空间内的座席人数:

[difficult to find the current location of agents in Anylogic simulation

count(pedGoTo.getPeds(),p->p.getX()>279 && p.getX()<302 && p.getY()>332 && p.getY()<349)

但是,此方法需要我输入坐标。我想计算可以在模型中移动的东西内部的行人数量,例如矩形节点(过程建模库)或矩形区域(行人图书馆)。有任何想法吗?谢谢!

1 个答案:

答案 0 :(得分:0)

您可以这样做:

<input name="ch3_training_days" type="text" value="0" maxlength="10" id="ch3_training_days" tabindex="8" title="Traning Days" class="DataFormTextBox" onblur="if(this.form.ch3_training_days.value>0) document.getElementById("ch3_training_days_benefit_total").focus();if(this.form.ch3_training_days.value<=0) document.getElementById("ch3_training_days_benefit_total").focus();"/>

<input name="ch3_training_days_benefit_total" type="text" maxlength="10" id="ch3_training_days_benefit_total" tabindex="168" title="Total" class="DataFormDropDownList" placeholder="Total" onfocus="if((this.form.ch3_training_days.value>0) && (this.form.ch3_training_days.value<=4)) ch3_training_days_benefit_total.value = Number(this.form.ch3_training_days.value*10); else if(this.form.ch3_training_days.value>4) ch3_training_days_benefit_total.value = '40'; else if((this.form.ch3_training_days.value<=0) || (this.form.ch3_training_days.value=='')) ch3_training_days_benefit_total.value = '0'; ch3_benefit_sub_total.value = ch3_training_days_benefit_total.value; document.getElementById('ch3_training_days_benefit_total').setAttribute('readonly', 'readonly');"/>


<textarea name="ch3_bsme" rows="2" cols="20" id="ch3_bsme" tabindex="13" title="Building Safety Month Event" class="DataFormTextBox" placeholder="Building Safety Month Event" onkeyup="TextLimit(this, 100)" onblur="TextLimit(this, 100)" onchange="var str = document.getElementById("ch3_bsme").value; var n = str.length; if(str.length<=0) document.getElementById("ch3_bsme_total").focus(); else if(str.length>0) document.getElementById("ch3_bsme_total").focus();">
</textarea>

<input name="ch3_bsme_total" type="text" maxlength="10" id="ch3_bsme_total" tabindex="15" title="Total" class="DataFormDropDownList" placeholder="Total" onfocus="var str = document.getElementById("ch3_bsme").value; var n = str.length; if(str.length<=0) ch3_bsme_total.value = '0'; else if(str.length>0) ch3_bsme_total.value = '10'; ch3_benefit_sub_total.value = ch3_bsme_total.value; document.getElementById('ch3_bsme_total').setAttribute('readonly', 'readonly');"/>


<input name="ch3_benefit_sub_total" type="text" value="0" maxlength="10" id="ch3_benefit_sub_total" tabindex="168" title="benefit sub-total" class="DataFormDropDownList" placeholder="benefit sub-total"/>
相关问题