     console.log "Generating experiment json for " + @ve.surface.elements.length +
       " elements"
 
+    data = {
+      computers: [],
+      routers: [],
+      switches: [],
+      lan_links: [],
+      wan_links: []
+    }
+
+    linkAdd = (l) ->
+      switch
+        when l.isInternet then data.wan_links.push(l)
+        else data.wan_links.push(l)
+
+    add = (e) ->
+      switch
+        when e instanceof BaseElements.Computer then data.computers.push(e.props)
+        when e instanceof BaseElements.Router then data.routers.push(e.props)
+        when e instanceof BaseElements.Switch then data.switches.push(e.props)
+        when e instanceof BaseElements.Link then linkAdd(e.props)
+        else console.log('unkown element -- ', e)
+
+    add(e) for e in @ve.surface.elements
+
+    console.log(data)
+    console.log(JSON.stringify(data, null, 2))
+
+    data
+
   swapIn: ->
     @expJson()
 


  #addBaseElements adds the common base elements to the ElementBox
  addBaseElements: ->
    @addElement((box, x, y) -> new BaseElements.Controller(box, x, y, 5))
    @addElement((box, x, y) -> new BaseElements.Router(box, x, y, 5))
    @addElement((box, x, y) -> new BaseElements.Switch(box, x, y, 5))
    @addElement((box, x, y) ->

      @shp.obj3d.userData = this
      @parent.obj3d.add(@shp.obj3d)
      @props = {
        name: "sw",
        sys: "",
        capacity: 1000,
        latency: 0
      }

    showProps: (f) ->
      f.add(@props, 'name')
      f.add(@props, 'sys')
      f.add(@props, 'capacity')
      f.add(@props, 'latency')
    
