基于JGraphX的通风网络解算---通风网络解算中出现风量为负值的处理

来源:互联网 发布:表情包文化 知乎 编辑:程序博客网 时间:2024/05/17 04:50

在通风网络计算中,如果风流的方向与分支的方向相反时,会出现风量解算结果为负数的情况,此时需要做相应的处理。

                                               <pre name="code" class="java">if(ve.getAirQ()<0){Node bn = (Node) c.getSource().getValue();//Node nbn = nl.getNode(bn.getLabel());Node en = (Node) c.getTarget().getValue();//Node nen = nl.getNode(en.getLabel());mxCell cs = (mxCell) c.getSource();mxCell ct = (mxCell) c.getTarget();c.setSource(ct);c.setTarget(cs);//c.getSource().setValue(en);//c.getTarget().setValue(bn);ve.setEnode(bn);ve.setBnode(en);c.setValue(ve);//mxPoint sp=c.getGeometry().getSourcePoint();//mxPoint tp=c.getGeometry().getTargetPoint();//c.getGeometry().setSourcePoint(tp);//c.getGeometry().setTargetPoint(sp);}

0 0