Package org.movsim.simulator.roadnetwork

Examples of org.movsim.simulator.roadnetwork.TrafficSink


            assert roadMapping != null;
            final int radius = (int) ((roadMapping.laneCount() + 2) * roadMapping.laneWidth());
            final RoadMapping.PosTheta posTheta;

            // draw the road segment sink, if there is one
            final TrafficSink sink = roadSegment.sink();
            if (sink != null) {
                g.setColor(sinkColor);
                posTheta = roadMapping.endPos();
                g.fillOval((int) posTheta.x - radius / 2, (int) posTheta.y - radius / 2, radius, radius);
                String outflowString = "outflow: " + (int) (Units.INVS_TO_INVH * sink.measuredOutflow()) + " veh/h";
                g.drawString(outflowString, (int) (posTheta.x) + radius / 2, (int) (posTheta.y) + radius / 2);
            }
        }
    }
View Full Code Here


                    break;
                }
            }
            if (!hasSink) {
                countSinks++;
                roadSegment.setSink(new TrafficSink(roadSegment));
            }
        }
        LOG.info("added {} default sinks to unconnected roads.", countSinks);
    }
View Full Code Here

TOP

Related Classes of org.movsim.simulator.roadnetwork.TrafficSink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.