CS计算机代考程序代写 # The interface function that integrates the Results with the Simulator

# The interface function that integrates the Results with the Simulator
# * add(::Results, value)

function add(s::Sum, value)
s.sum += value
s.n += 1
end

function add(s::BinomialStats, value)
s.sum += value
s.n += 1
end

function add(stats::NormalStats, value)
stats.sum += value
stats.sumSq += value^2
stats.min = min(stats.min, value)
stats.max = max(stats.max, value)
stats.n += 1
end

function add(sv::StoredValues, value)
sv[fillindex(sv)] = value
sv.loc += 1
end