001    package aima.probability.reasoning;
002    
003    /**
004     * @author Ravi Mohan
005     * 
006     */
007    
008    public class Particle {
009    
010            private String state;
011    
012            private double weight;
013    
014            public Particle(String state, double weight) {
015                    this.state = state;
016                    this.weight = weight;
017            }
018    
019            public Particle(String state) {
020                    this(state, 0);
021            }
022    
023            public boolean hasState(String aState) {
024    
025                    return state.equals(aState);
026            }
027    
028            public String getState() {
029                    return state;
030            }
031    
032            public double getWeight() {
033                    return weight;
034            }
035    
036            public void setWeight(double particleWeight) {
037                    weight = particleWeight;
038    
039            }
040    
041    }