 
   # Called after the simulation stops
   end = ->
+    return 
     total_energy = calculate_global_energy()
     console.log('Simulation complete after ' + ticks + ' ticks. ' + 
                 'Energy of system could be reduced by at most ' + total_energy + ' by global sort.')

        opinions = for opinion, i in @props.opinions
          {stance: opinion.stance, icon: icons[i], radius: icons[i].style.width/2}

        positionAvatars(@props.width, @props.height, opinions)
        
        @local.simulation_opinion_hash = simulation_opinion_hash
        save @local

# Uses a d3-based physics simulation to calculate a reasonable layout
# of avatars within a given area.

positionAvatars = (width, height, opinions, r) ->
  width = width || 400
  height = height || 70

  opinions = opinions.slice()
              .sort( (a,b) -> a.stance-b.stance )
  n = opinions.length
  x_force_mult = 2
  y_force_mult = if height <= 100 then 2 else 6
  ticks = 0

  stances = {}

  # Initialize positions of each node
  nodes = d3.range(opinions.length).map (i) ->
    radius = opinions[i].radius || r
