1 package org.sat4j.maxsat.reader;
2
3 import org.sat4j.maxsat.WeightedMaxSatDecorator;
4 import org.sat4j.pb.reader.PBInstanceReader;
5 import org.sat4j.reader.Reader;
6
7 public class MSInstanceReader extends PBInstanceReader{
8
9 private final WeightedMaxSatDecorator solver;
10
11 public MSInstanceReader(WeightedMaxSatDecorator solver) {
12 super(solver);
13 this.solver = solver;
14 }
15
16 @Override
17 protected Reader handleFileName(String fname, String prefix) {
18 if (fname.endsWith(".wcnf")) {
19 return new WDimacsReader(this.solver);
20 }
21 return super.handleFileName(fname, prefix);
22 }
23
24 }