Projects >> blog >>863bda589dec05bc71a2558a789287bcbffc0925

Chunk
Conflicting content
      dataLogLik += logSumWeights;

<<<<<<< HEAD
			// System.out.println("PF: Num of particles after taking evidence: " +
			// particles.size());
			// System.out.println("PF: Log sum of weights after taking evidence: " + logSumWeights);

			needsToBeResampledBeforeFurtherSampling = true;

			if (useDecayedMCMC)
				dmhSampler.add(evidence);

			if (afterTakesEvidence != null)
				afterTakesEvidence.evaluate(evidence, this);

		}
	}

	/**
	 * Answer queries according to current distribution represented by filter.
	 */
	public void answer(Collection queries) {
		if (particles == null)
			// Util.fatalError("ParticleFilter.take(Evidence) called before initialization of particles.");
			resetAndTakeInitialEvidence();

		// System.out.println("PF: Updating queries with PF with " +
		// particles.size() + " particles.");
		for (Iterator it = particles.iterator(); it.hasNext();) {
			Particle p = (Particle) it.next();
			p.answer(queries);
		}
		if (useDecayedMCMC)
			dmhSampler.addQueries(queries);
	}

	public void answer(Query query) {
		answer(Util.list(query));
	}

	protected void resample() {
		double[] logWeights = new double[particles.size()];
		boolean[] alreadySampled = new boolean[particles.size()];
		double logSumWeights = Double.NEGATIVE_INFINITY;
=======
      // System.out.println("PF: Num of particles after taking evidence: " +
      // particles.size());
      // System.out.println("PF: Log sum of weights after taking evidence: " +
      // logSumWeights);

      needsToBeResampledBeforeFurtherSampling = true;

      if (useDecayedMCMC)
        dmhSampler.add(evidence);

      if (afterTakesEvidence != null)
        afterTakesEvidence.evaluate(evidence, this);
    }
  }

  /**
   * Answer queries according to current distribution represented by filter.
   */
  public void answer(Collection queries) {
    if (particles == null)
      // Util.fatalError("ParticleFilter.take(Evidence) called before initialization of particles.");
      resetAndTakeInitialEvidence();

    // System.out.println("PF: Updating queries with PF with " +
    // particles.size() + " particles.");
    // for (Iterator it = particles.iterator(); it.hasNext();) {
    // Particle p = (Particle) it.next();
    // p.answer(queries);
    // }
    if (useDecayedMCMC)
      dmhSampler.addQueries(queries);
  }

  public void answer(Query query) {
    answer(Util.list(query));
  }

  private void resample() {
    double[] logWeights = new double[particles.size()];
    boolean[] alreadySampled = new boolean[particles.size()];
    double logSumWeights = Double.NEGATIVE_INFINITY;
>>>>>>> d09e374abf27f0f545913c7ce159038de5dddd7d
    double[] normalizedWeights = new double[particles.size()];
    List newParticles = new ArrayList();
Solution content
      dataLogLik += logSumWeights;

      // System.out.println("PF: Num of particles after taking evidence: " +
      // particles.size());
      // System.out.println("PF: Log sum of weights after taking evidence: " +
      // logSumWeights);

      needsToBeResampledBeforeFurtherSampling = true;

      if (useDecayedMCMC)
        dmhSampler.add(evidence);

      if (afterTakesEvidence != null)
        afterTakesEvidence.evaluate(evidence, this);
    }
  }

  /**
   * Answer queries according to current distribution represented by filter.
   */
  public void answer(Collection queries) {
    if (particles == null)
      // Util.fatalError("ParticleFilter.take(Evidence) called before initialization of particles.");
      resetAndTakeInitialEvidence();

    // System.out.println("PF: Updating queries with PF with " +
    // particles.size() + " particles.");
    // for (Iterator it = particles.iterator(); it.hasNext();) {
    // Particle p = (Particle) it.next();
    // p.answer(queries);
    // }
    if (useDecayedMCMC)
      dmhSampler.addQueries(queries);
  }

  public void answer(Query query) {
    answer(Util.list(query));
  }

  protected void resample() {
    double[] logWeights = new double[particles.size()];
    boolean[] alreadySampled = new boolean[particles.size()];
    double logSumWeights = Double.NEGATIVE_INFINITY;
    double[] normalizedWeights = new double[particles.size()];
    List newParticles = new ArrayList();
File
ParticleFilter.java
Developer's decision
Combination
Kind of conflict
Comment
If statement
Method declaration
Method invocation
Method signature
Variable