Property definitions

nitc $ CNVI :: defaultinit
# Class Novelty Index
# cnvi = |LocS(class)| / cbms(parents(class))
class CNVI
	super MClassMetric
	super FloatMetric
	redef fun name do return "cnvi"
	redef fun desc do return "class novelty index, contribution of the class to its branch in term of introductions"

	redef fun collect(mclasses) do
		var cbms = new CBMS(model, mainmodule, filter)
		for mclass in mclasses do
			# compute branch mean size
			var parents = mclass.in_hierarchy(mainmodule).direct_greaters
			if parents.length > 0 then
				cbms.clear
				cbms.collect(new HashSet[MClass].from(parents))
				# compute class novelty index
				var locc = mclass.collect_accessible_mproperties(mainmodule, filter).length
				values[mclass] = locc.to_f / cbms.avg
			else
				values[mclass] = 0.0
			end
		end
	end
end
src/metrics/mendel_metrics.nit:167,1--191,3