public String toStringFile() throws UnInitializatedException {
        if (this.generators == null || this.loads == null) {
            if (debug >= 3) {
                String dmethod = Thread.currentThread().getStackTrace()[2].getMethodName();
                String dclass = Thread.currentThread().getStackTrace()[2].getClassName();
                System.out.println("---------------------------------------");
                System.out.println("[class: " + dclass + " method: " + dmethod + "] " + "UnInitialized instance of Power Grid");
                System.out.println("---------------------------------------");
            }
            throw new UnInitializatedException();
        }
        StringBuilder stringFile = new StringBuilder();
        for (Generator git : this.getGenerators()) {
            stringFile.append("G ").append(git.getId()).append(" ").append(git.getPower());
            for (Load git_l : git.getLoads()) {
                stringFile.append(" ").append( git_l.getId());
            }
            CO2Simple co = (CO2Simple) git.getCo2();
            stringFile.append("\nS ").append(co.getMult()).append(" ").append(co.getMaxPower()).append("\n");

        }

        for (Load lit : this.getLoads()) {
            stringFile.append("L ").append(lit.getId()).append(" ").append(lit.getRequiredPower());
            for (Generator lit_g : lit.getGenerators()) {
                stringFile.append(" ").append(lit_g.getId());
            }
            stringFile.append("\n");
        }

        return stringFile.toString();
    }