예제 #1
0
    def stateCallback(ctrl, state):
        if state == Controller.State.ALLOCATING:
            show('Allocating transposition and proof tables...')
        elif state == Controller.State.SEARCHING:
            show('... Done. Commencing search.')

            global start, startCpu

            start = time.time()
            startCpu = clock()
예제 #2
0
파일: cmdline.py 프로젝트: Oxyd/APNS
  def stateCallback(ctrl, state):
    if state == Controller.State.ALLOCATING:
      show('Allocating transposition and proof tables...')
    elif state == Controller.State.SEARCHING:
      show('... Done. Commencing search.')

      global start, startCpu

      start = time.time()
      startCpu = clock()
예제 #3
0
    controller.searchProgressCallbacks.add(printProgress)
    show('Starting search. Pres Control-C to stop the search at any time.')

    try:
        controller.runSearch(burst=1000)
    except RuntimeError, e:
        print >> sys.stderr, \
          'Internal error has occured; this is likely a bug.\n\n' + str(e)
        raise SystemExit(EXIT_ERROR)
    except MemoryError:
        print >> sys.stderr, \
          'Error: The program ran out of memory while trying to expand the tree.'
        raise SystemExit(EXIT_ERROR)

    end = time.time()
    endCpu = clock()

    exitStatus = None

    if not args.quiet or args.noProgress:
        print 'Search finished:',
        if controller.root.proofNumber == 0:
            print 'Root vertex is proved'
            exitStatus = EXIT_FINISHED
        elif controller.root.disproofNumber == 0:
            print 'Root vertex is disproved'
            exitStatus = EXIT_FINISHED
        elif params.timeLimit > 0 and \
            controller.stats.timeElapsed >= params.timeLimit:
            print 'Time limit exceeded'
            exitStatus = EXIT_LIMIT
예제 #4
0
파일: cmdline.py 프로젝트: Oxyd/APNS
  controller.searchProgressCallbacks.add(printProgress)
  show('Starting search. Pres Control-C to stop the search at any time.')

  try:
    controller.runSearch(burst=1000)
  except RuntimeError, e:
    print >> sys.stderr, \
      'Internal error has occured; this is likely a bug.\n\n' + str(e)
    raise SystemExit(EXIT_ERROR)
  except MemoryError:
    print >> sys.stderr, \
      'Error: The program ran out of memory while trying to expand the tree.'
    raise SystemExit(EXIT_ERROR)

  end = time.time()
  endCpu = clock()

  exitStatus = None

  if not args.quiet or args.noProgress:
    print 'Search finished:',
    if controller.root.proofNumber == 0:
      print 'Root vertex is proved'
      exitStatus = EXIT_FINISHED
    elif controller.root.disproofNumber == 0:
      print 'Root vertex is disproved'
      exitStatus = EXIT_FINISHED
    elif params.timeLimit > 0 and \
        controller.stats.timeElapsed >= params.timeLimit:
      print 'Time limit exceeded'
      exitStatus = EXIT_LIMIT