python类Exception()的实例源码

pywraplp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self, name: 'std::string const &', problem_type: 'operations_research::MPSolver::OptimizationProblemType'):
        this = _pywraplp.new_Solver(name, problem_type)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywraplp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self):
        this = _pywraplp.new_MPSolverParameters()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapknapsack_solver.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
pywrapknapsack_solver.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, *args):
        this = _pywrapknapsack_solver.new_KnapsackSolver(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self):
        this = _pywrapcp.new_DefaultPhaseParameters()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, *args):
        this = _pywrapcp.new_Solver(*args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

        self.__python_constraints = []
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
        if self.__class__ == BaseObject:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_BaseObject(_self, )
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, s: 'Solver'):
        if self.__class__ == PropagationBaseObject:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_PropagationBaseObject(_self, s)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self):
        if self.__class__ == Decision:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_Decision(_self, )
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
        if self.__class__ == Demon:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_Demon(_self, )
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, solver: 'Solver'):
        if self.__class__ == Constraint:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_Constraint(_self, solver)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, s: 'Solver'):
        if self.__class__ == SearchMonitor:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_SearchMonitor(_self, s)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, val: 'long long const &'):
        this = _pywrapcp.new_RevInteger(val)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, val: 'long long const &'):
        this = _pywrapcp.new_NumericalRevInteger(val)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self, *args):
        if self.__class__ == IntVarLocalSearchOperator:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_IntVarLocalSearchOperator(_self, *args)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, vars: 'std::vector< operations_research::IntVar *,std::allocator< operations_research::IntVar * > > const &'):
        if self.__class__ == BaseLns:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_BaseLns(_self, vars)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self, vars: 'std::vector< operations_research::IntVar *,std::allocator< operations_research::IntVar * > > const &'):
        if self.__class__ == ChangeValue:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_ChangeValue(_self, vars)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, vars: 'std::vector< operations_research::IntVar *,std::allocator< operations_research::IntVar * > > const &'):
        if self.__class__ == IntVarLocalSearchFilter:
            _self = None
        else:
            _self = self
        this = _pywrapcp.new_IntVarLocalSearchFilter(_self, vars)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def ApplyWrapper(self, solver):
    try:
       self.Apply(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise
pywrapcp.py 文件源码 项目:aws_lambda_ortools 作者: tunamonster 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def NextWrapper(self, solver):
    try:
      return self.Next(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        return solver.FailDecision()
      else:
        raise


问题


面经


文章

微信
公众号

扫码关注公众号