1
6 import java.util.*;
7 import java.io.*;
8 import java.awt.*;
9 import javax.swing.*;
10
11
12 public class LayerProb extends Layer {
13
14 private static final long serialVersionUID = Version.getSUID();
15
16
17 double prob;
18
19
20 LayerProb(double prob) {
21 this.prob = prob;
22 name = "%"+((int)(prob*100));
23 }
24
25
26 public Object clone() {
27 return((Object)new LayerProb(prob));
28 }
29
30
31 public void copy(FileDefaultable thatitem) {
32 super.copy(thatitem);
33 prob = ((LayerProb)thatitem).prob;
34 }
35
36
40 public boolean isMember(Object target) {
41 return(Math.random()<prob);
42 }
43 }
44