private void initFlowPhases() {
        int tmpphase = 0;
        for(Street incoming:this.incomingStreets.values()) {
            for(Street outgoing: this.routing.get(incoming).values()) {
                IntersectionStreet is = new IntersectionStreet(5,incoming.getNumOfLanes(),incoming.getId() + outgoing.getId());
                is.initStreet(incoming.getEnd(),outgoing.getStart());
                for(IntersectionStreet tmpis: StreetPhases) {
                    if(!checkStreetCollision(tmpis,is) || (tmpis.getEnd() == is.getStart() && tmpis.getStart() == tmpis.getEnd())) {
                        is.setPhase(tmpis.getPhase());
                        StreetPhases.add(is);
                        break;
                    }
                }
                if(!StreetPhases.contains(is)) {
                    is.setPhase(tmpphase);
                    StreetPhases.add(is);
                    tmpphase++;
                }

            }
        }
        this.maxPhase = tmpphase-1;
    }