AIMA.Core.Probability.Reasoning.ParticleSet.numberOfParticlesWithState C# (CSharp) Method

numberOfParticlesWithState() public method

public numberOfParticlesWithState ( String state ) : int
state String
return int
        public int numberOfParticlesWithState(String state) {
		int total = 0;
		foreach (Particle p in particles) {
			if (p.hasState(state)) {
				total += 1;
			}
		}
		return total;
	}