anchor.diff: -% @copyright 2007-2014 Zuse Institute Berlin
  +% @copyright 2007-2014, 2018 Zuse Institute Berlin
   
   %   Licensed under the Apache License, Version 2.0 (the "License");
   %   you may not use this file except in compliance with the License.
  
positive.code: -spec get_average_rt_size(Ring::ring()) -> float().
  get_average_rt_size(Ring) ->
      FilteredRing = lists:filter(fun (X) -> is_valid(X) end, Ring),
      get_total_rt_size(FilteredRing) / length(FilteredRing).
  
  -spec get_rt_size_std_deviation(Ring::ring()) -> float().
  get_rt_size_std_deviation(Ring) ->
      FilteredRing = lists:filter(fun (X) -> is_valid(X) end, Ring),
      Average = get_average_rt_size(FilteredRing),
      math:sqrt(lists:foldl(fun (RTSize, Acc) ->
                                     Acc + (RTSize - Average) * (RTSize - Average)
                            end, 0,
                            lists:map(fun get_rt/1, FilteredRing)) / length(FilteredRing)).
  
  -spec get_rt(ring_element()) -> node_details:rt_size().
  get_rt({ok, Details}) ->
  
negative.code: -spec get_load_std_deviation(Which::load(), Ring::ring()) -> float().
  get_load_std_deviation(Which, Ring) ->
      FilteredRing = lists:filter(fun (X) -> is_valid(X) end, Ring),
      case length(FilteredRing) of
          0 -> 0.0;
          _ ->
              Average = get_average_load(Which, FilteredRing),
              math:sqrt(lists:foldl(fun (Load, Acc) ->
                                            Acc + (Load - Average)
                                                * (Load - Average)
                                    end, 0,
                                    lists:map(fun(Node) ->
                                                      get_load(Which, Node)
                                              end,
                                              FilteredRing))
                        / length(FilteredRing))
      end.
  
  -spec get_load(Which::load(), ring_element()) -> node_details:load().
  get_load(Which, {ok, Details}) ->
  