Exemplo n.º 1
0
func runBench(file string, b dpll.BranchRule, d db.ClauseDBMS) *guess.Guess {

	runtime.GOMAXPROCS(3)
	timeout := time.After(20 * time.Minute)

	// Prepare the specific run
	br := dpll.NewBrancher()
	br.SetRule(b)
	ma := db.NewManager()
	ma.SetStrat(d)

	// Initialize the cdb and assignment
	cdb, a, err := initSolver(file)
	if err != nil {
		log.Fatal(err)
	}
	// Set the proper max db size
	ma.MaxLearned = cdb.NGiven() / 3

	g := dpll.DpllTimeout(cdb, a, br, ma, nil, timeout)
	return g
}
Exemplo n.º 2
0
func runAdaptiveBench(file string, jsonFile string, chooseOnce bool, extraStats bool) (*guess.Guess, *dpll.Adapter) {

	runtime.GOMAXPROCS(3)
	timeout := time.After(20 * time.Minute)

	// Initialize the cdb and assignment
	cdb, a, err := initSolver(file)
	if err != nil {
		log.Fatal(err)
	}
	// Set the proper max db size
	manage.MaxLearned = cdb.NGiven() / 3
	// Read the data from the file and make the adapter
	adapt := dpll.NewAdapter(jsonFile, chooseOnce, extraStats)
	// Use the adapter to set the initial state
	b := dpll.NewBrancher()
	m := db.NewManager()
	adapt.Reconfigure(cdb, b, m)

	g := dpll.DpllTimeout(cdb, a, b, m, adapt, timeout)
	return g, adapt
}