code: public void generateDot(Model mo, String out, boolean fromLeftToRight) throws IOException {
  
          try (BufferedWriter dot = new BufferedWriter(new FileWriter(out))) {
              dot.append("digraph G {\n");
              if (fromLeftToRight) {
                  dot.append("rankdir=LR;\n");
              }
              drawNodes(dot, NamingService.getNodeNames(mo));
              drawSwitches(dot);
              drawLinks(dot);
              dot.append("}\n");
          }
      }
docs: Generate a dot file (diagram) of the current network infrastructure, included all connected elements and links.
  
  @param mo                the model to use, it may contains naming services for switches or nodes that will
  replace the generic names mainly based on the id number.
  @param out               the output dot file to create
  @param fromLeftToRight   if true: force diagram's shapes to be placed side by side (create larger diagrams)
  @throws IOException if an error occurred while writing