<commit_before>package etomica.virial;

import etomica.api.IAtomSet;
import etomica.api.IPotential;
import etomica.potential.PotentialCalculation;

/**
 * Calculates the cluster weight associated with current configuration.
 */

public class PotentialCalculationClusterWeightSum implements PotentialCalculation {
        
    public void reset() {
        weight = 1.0;
    }
    public double weight() {
        return weight;
    }

    public void doCalculation(IAtomSet atoms, IPotential potential) {
        weight *= ((P0Cluster)potential).weight();
	}

    protected double weight;
}<commit_msg>restore check for P0Cluster that was removed as part of the PotentialCalculation shakeup<commit_after>package etomica.virial;

import etomica.api.IAtomSet;
import etomica.api.IPotential;
import etomica.potential.PotentialCalculation;

/**
 * Calculates the cluster weight associated with current configuration.
 */

public class PotentialCalculationClusterWeightSum implements PotentialCalculation {
        
    public void reset() {
        weight = 1.0;
    }
    public double weight() {
        return weight;
    }

    public void doCalculation(IAtomSet atoms, IPotential potential) {
        // we'll also get intramolecular potentials... ignore them
        if (potential instanceof P0Cluster) {
            weight *= ((P0Cluster)potential).weight();
        }
	}

    protected double weight;
}
{'fraction_non_alphanumeric': 0.07965860597439545, 'fraction_numerical': 0.005689900426742532, 'mean_word_length': 3.369565217391304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6961855', 'n_tokens_mistral': 410, 'n_tokens_neox': 377, 'n_words': 107}