source: projects/CooprNEOSPlugin/trunk/coopr/plugins/neos/NEOS_CBC.py @ 14

Last change on this file since 14 was 14, checked in by anonymous, 12 years ago

Importing CooprNEOSPlugin

File size: 869 bytes
Line 
1
2__all__ = []
3
4import pyutilib
5import re
6import NEOS
7from coopr.opt.base import *
8from coopr.opt.results import *
9
10
11class NEOS_CBC(NEOS.NEOSRemoteSolver):
12    """A wrapper class for NEOS CBC Solvers"""
13
14    def __init__(self, **kwds):
15        kwds['type'] = 'neos_cbc'
16        self.neos_name="Cbc"
17        NEOS.NEOSRemoteSolver.__init__(self, **kwds)
18
19    def create_command_line(self,executable,problem_files):
20        self.tmp_opt = SolverFactory('cbc')
21        self.tmp_opt._problem_format = ProblemFormat.nl
22        self.tmp_opt._results_format = ResultsFormat.sol
23        self.tmp_opt.create_command_line('cbc',problem_files)
24        self.tmp_opt._symbol_map = self._symbol_map
25        self.solver_options = self.tmp_opt._nl_options
26        return NEOS.NEOSRemoteSolver.create_command_line(self,executable,problem_files)
27
28SolverRegistration("neos_cbc", NEOS_CBC)
29
Note: See TracBrowser for help on using the repository browser.