2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
* Copyright (C) 2003 University of Waikato, Hamilton, New Zealand
23
package weka.gui.boundaryvisualizer;
25
import java.io.Serializable;
28
* Class that encapsulates a result (and progress info) for part
29
* of a distributed boundary visualization. The result of a sub-task
30
* is the probabilities necessary to display one row of the final
33
* @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a>
34
* @version $Revision: 1.3 $
38
public class RemoteResult
39
implements Serializable {
41
/** for serialization */
42
private static final long serialVersionUID = 1873271280044633808L;
44
/** the row number that this result corresponds to */
45
private int m_rowNumber;
47
/** how many pixels in a row */
48
private int m_rowLength;
50
/** the result - ie. the probability distributions produced by the
51
* classifier for this row in the visualization */
52
private double [][] m_probabilities;
54
/** progress on computing this row */
55
private int m_percentCompleted;
58
* Creates a new <code>RemoteResult</code> instance.
60
* @param rowNum the row number
61
* @param rowLength the number of pixels in the row
63
public RemoteResult(int rowNum, int rowLength) {
64
m_probabilities = new double[rowLength][0];
68
* Store the classifier's distribution for a particular pixel in the
71
* @param index the pixel
72
* @param distribution the probability distribution from the classifier
74
public void setLocationProbs(int index, double [] distribution) {
75
m_probabilities[index] = distribution;
79
* Return the probability distributions for this row in the visualization
81
* @return the probability distributions
83
public double [][] getProbabilities() {
84
return m_probabilities;
88
* Set the progress for this row so far
90
* @param pc a percent completed value
92
public void setPercentCompleted(int pc) {
93
m_percentCompleted = pc;
97
* Return the progress for this row
99
* @return a percent completed value
101
public int getPercentCompleted() {
102
return m_percentCompleted;