Examples of IRoad


Examples of trafficjams.model.interfaces.IRoad

    }

    public IRoad getNextElement(IMapElement _currentElement, boolean fToL) throws Exception {

        if(_currentElement.getClass().equals(IRoad.class)){
            IRoad currentElement = (IRoad) _currentElement;
            ICrossRoad first = currentElement.getFCross();
            ICrossRoad last =  currentElement.getLCross();
            ICrossRoad nextCross = this.getNextCross(first,last);

            if (nextCross !=null){

                if (nextCross.equals(first)&&!fToL){
View Full Code Here

Examples of trafficjams.model.interfaces.IRoad

                    CrossRoad c1 = (CrossRoad)((Road)rd[1]).getOtherEnd(cr);

                    if (!(roads.remove(rd[0]) && roads.remove(rd[1])))
                        throw new Exception("road remove error");

                    IRoad newRoad = this.createConnector(c0,c1);
                    roads.add(newRoad);
                    ((CrossRoad) c0).setRoadForDirection(newRoad, c0.deleteRoad(rd[0]));
                    ((CrossRoad) c1).setRoadForDirection(newRoad, c1.deleteRoad(rd[1]));
                }
            }
View Full Code Here

Examples of trafficjams.model.interfaces.IRoad

        return 0//To change body of implemented methods use File | Settings | File Templates.
    }

    public IElementPosition getNextPosition(IVehicle vehicle, float distance, IRoad nextElement) throws Exception {
        try{
            IRoad from = (IRoad)vehicle.getCurrentElement();
            IRoad to = nextElement;
            return this.tryToKeepFor(vehicle,from, to);
        }catch (Exception ex){
            try{
                return this.findQueue(vehicle, distance, nextElement);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.