Example #1
0
def parse(domain_file, problem_file):
  domain_line = parse_nested_list(file(domain_file))
  problem_line = parse_nested_list(file(problem_file))

  domain = tasks.parse_domain(domain_line)
  problem = tasks.parse_task(problem_line)
  
  task = ground.ground(domain, problem)
  return task
Example #2
0
def read_and_insert():
    db = db_filepath('laptop')
    end = datetime.utcnow()
    with sqlite3.connect(db) as conn:
        tasks = {id_: name.lower() for id_, name in
                 get_project_list(conn).items()}
        next_task = parse_task([x.lower() for x in tasks.values()], sys.argv)
        task = make_task(next_task, tasks)
        print(task)
        pending_file = mk_path(get_data_saving_path('tracker'), '_tsk')
        if task is None:
            insert_pending_task(conn, end, pending_file)
            return
        pending = task['end'] is None
        if pending:
            insert_pending_task(conn, end, pending_file)
            save_var(pending_file, task)
        else:
            insert_task(conn, task)
Example #3
0
      yield list(parse_list_helper(tokenstream))
    else:
      yield token
      

if __name__ == "__main__":
  import strips
  import ground
  
  domain_file = 'domain.pddl'
  task_file = 'p0.pddl'
  domain_line = parse_nested_list(file(domain_file))
  task_line = parse_nested_list(file(task_file))
  domain = tasks.parse_domain(domain_line)
  predicates, actions = domain
  task = tasks.parse_task(task_line)
  [problem_name, objects, init, goal] = task

  print "Problem Name: " + problem_name

  #print "Predicates:"
  #for e in predicates:
  #  print '\t', e, '\n'
  #print "Actions:"
  #for e in actions:
  #  print '\t', e, '\n'

  statics = ground.get_static_predicates(predicates, actions)
  #print "Statics Predicate:"
  #for e in statics:
  #  print '\t', e, '\n'