为什么repast j for java中的这段代码会创建两倍于;“外缘”;

为什么repast j for java中的这段代码会创建两倍于;“外缘”;,java,agent,repast-simphony,Java,Agent,Repast Simphony,我正在建模一个包含客户、零售商和供应商的供应链。它们在一个节点中连接。我找到了这个代码。但我不明白,为什么这段代码会创建双倍数量的outedge。也许有人能帮忙 while (it.hasNext()) { // Find the next agent to link to. tempAgent = (supply_chain_agent) it.next(); System.out.pr

我正在建模一个包含客户、零售商和供应商的供应链。它们在一个节点中连接。我找到了这个代码。但我不明白,为什么这段代码会创建双倍数量的outedge。也许有人能帮忙

      while (it.hasNext()) {
                // Find the next agent to link to.
                tempAgent = (supply_chain_agent) it.next();
                System.out.println(tempAgent);


                // Create an edge from the last agent to the temp agent.
                tempEdge = new supply_chain_edge("Orders", 1, this.initialOrderPerTimeStep);

                // Connect the new edge.
                tempAgent.addInEdge(tempEdge);
                System.out.println(tempEdge.getLabel());

                lastAgent.addOutEdge(tempEdge);
                System.out.println(tempEdge.getLabel());

                tempEdge.setTo(tempAgent);
                tempEdge.setFrom(lastAgent);

                // Create an edge from the temp agent to the last agent.
                if (lastAgent.getNodeLabel().startsWith("Customer")) {
                    tempEdge = new supply_chain_edge("Shipments", this.ordering_delay, this.initialOrderPerTimeStep);
                } else {
                    tempEdge = new supply_chain_edge("Shipments", this.delivery_delay, this.initialOrderPerTimeStep);
                }

                // Connect the new edge.
                lastAgent.addInEdge(tempEdge);
                System.out.println(tempEdge.getLabel());

                tempAgent.addOutEdge(tempEdge);
                System.out.println(tempEdge.getLabel());

                tempEdge.setTo(lastAgent);
                tempEdge.setFrom(tempAgent);

                // Move on.
                lastAgent = tempAgent;
                System.out.println(lastAgent);

            }

请提供更多的代码,因为你在处理“订单”和“出货”,你可以考虑改名“OutEdGE”,因为在英语口语中,它听起来像“停电”——换句话说,完全缺乏库存。