View Javadoc

1   package org.sat4j.tools;
2   
3   import java.io.FileNotFoundException;
4   import java.io.FileOutputStream;
5   import java.io.PrintStream;
6   
7   import org.sat4j.specs.IConstr;
8   import org.sat4j.specs.Lbool;
9   import org.sat4j.specs.SearchListener;
10  
11  /**
12   * @since 2.2
13   */
14  public class DecisionTracing implements SearchListener {
15  
16  	/**
17  	 * 
18  	 */
19  	private static final long serialVersionUID = 1L;
20  
21  	private final String filename;
22  	private PrintStream out;
23  
24  	public DecisionTracing(String filename) {
25  		this.filename = filename;
26  		updateWriter();
27  	}
28  
29  	private void updateWriter() {
30  		try {
31  			out = new PrintStream(new FileOutputStream(filename + ".dat"));
32  		} catch (FileNotFoundException e) {
33  			out = System.out;
34  		}
35  	}
36  
37  	public void adding(int p) {
38  		// TODO Auto-generated method stub
39  
40  	}
41  
42  	public void assuming(int p) {
43  		out.println(Math.abs(p));
44  	}
45  
46  	public void backtracking(int p) {
47  		// TODO Auto-generated method stub
48  
49  	}
50  
51  	public void beginLoop() {
52  		// TODO Auto-generated method stub
53  
54  	}
55  
56  	public void conflictFound(IConstr confl, int dlevel, int trailLevel) {
57  		// TODO Auto-generated method stub
58  
59  	}
60  
61  	public void conflictFound(int p) {
62  		// TODO Auto-generated method stub
63  
64  	}
65  
66  	public void delete(int[] clause) {
67  		// TODO Auto-generated method stub
68  
69  	}
70  
71  	public void end(Lbool result) {
72  		out.close();
73  
74  	}
75  
76  	public void learn(IConstr c) {
77  		// TODO Auto-generated method stub
78  
79  	}
80  
81  	public void propagating(int p, IConstr reason) {
82  		// TODO Auto-generated method stub
83  
84  	}
85  
86  	public void solutionFound() {
87  		// TODO Auto-generated method stub
88  
89  	}
90  
91  	public void start() {
92  
93  	}
94  
95  	public void restarting() {
96  		// out.close();
97  		// restartNumber++;
98  		// updateWriter();
99  	}
100 
101 	public void backjump(int backjumpLevel) {
102 	}
103 
104 }