def UserGoalsMidca(domainFile, stateFile, goalsFile = None, extinguish = False): world = domainread.load_domain(domainFile) stateread.apply_state_file(world, stateFile) myMidca = base.PhaseManager(world, verbose=1, display = asqiiDisplay, metaEnabled=True) # add cognitive layer phases for phase in ["Simulate", "Perceive", "Interpret", "Eval", "Intend", "Plan", "Act"]: myMidca.append_phase(phase) # add cognitive layer modules myMidca.append_module("Simulate", simulator.MidcaActionSimulator()) myMidca.append_module("Simulate", simulator.ASCIIWorldViewer()) myMidca.append_module("Perceive", perceive.PerfectObserver()) myMidca.append_module("Interpret", note.ADistanceAnomalyNoter()) myMidca.append_module("Interpret", guide.UserGoalInput()) myMidca.append_module("Eval", evaluate.SimpleEval()) myMidca.append_module("Intend", intend.SimpleIntend()) myMidca.append_module("Plan", planningbroken.PyHopPlannerBroken(extinguish)) myMidca.append_module("Act", act.SimpleAct()) # add meta layer phases #for phase in ["Monitor", "Interpret", "Eval", "Intend", "Plan", "Control"]: for phase in ["Monitor", "Interpret", "Intend", "Plan", "Control"]: myMidca.append_meta_phase(phase) # add meta layer modules myMidca.append_meta_module("Monitor", monitor.MRSimpleMonitor()) myMidca.append_meta_module("Interpret", interpret.MRSimpleDetect()) myMidca.append_meta_module("Interpret", interpret.MRSimpleGoalGen()) myMidca.append_meta_module("Intend", metaintend.MRSimpleIntend()) myMidca.append_meta_module("Plan", plan.MRSimplePlanner()) myMidca.append_meta_module("Control", control.MRSimpleControl()) return myMidca
def UserGoalsMidca(domainFile, stateFile, goalsFile=None, extinguish=False): world = domainread.load_domain(domainFile) stateread.apply_state_file(world, stateFile) myMidca = base.PhaseManager(world, display=asqiiDisplay) for phase in [ "Simulate", "Perceive", "Interpret", "Eval", "Intend", "Plan", "Act" ]: myMidca.append_phase(phase) myMidca.append_module("Simulate", simulator.MidcaActionSimulator()) myMidca.append_module("Simulate", simulator.ASCIIWorldViewer()) myMidca.append_module("Perceive", perceive.PerfectObserver()) myMidca.append_module("Interpret", note.ADistanceAnomalyNoter(5, 0.1)) myMidca.append_module("Interpret", guide.UserGoalInput()) myMidca.append_module("Eval", evaluate.SimpleEval()) myMidca.append_module("Intend", intend.SimpleIntend()) myMidca.append_module("Plan", planning.PyHopPlanner(extinguish)) myMidca.append_module("Act", act.SimpleAct()) return myMidca
def UserGoalsMidca(domainFile, stateFile, goalsFile=None, extinguish=False): world = domainread.load_domain(domainFile) stateread.apply_state_file(world, stateFile) #creates a PhaseManager object, which wraps a MIDCA object myMidca = base.PhaseManager(world, display=asqiiDisplay) #add phases by name for phase in [ "Simulate", "Perceive", "Interpret", "Eval", "Intend", "Plan", "Act" ]: myMidca.append_phase(phase) #add the modules which instantiate basic blocksworld operation myMidca.append_module("Simulate", simulator.MidcaActionSimulator()) myMidca.append_module("Simulate", simulator.ASCIIWorldViewer()) myMidca.append_module("Perceive", perceive.PerfectObserver()) myMidca.append_module("Interpret", note.ADistanceAnomalyNoter()) myMidca.append_module("Interpret", guide.UserGoalInput()) myMidca.append_module("Eval", evaluate.SimpleEval()) myMidca.append_module("Intend", intend.SimpleIntend()) myMidca.append_module("Plan", planning.PyHopPlanner(extinguish)) myMidca.append_module("Act", act.SimpleAct()) return myMidca
myMidca = base.PhaseManager(world, display=DISPLAY_FUNC, verbose=4) #add phases by name for phase in [ "Simulate", "Perceive", "Interpret", "Eval", "Intend", "Plan", "Act" ]: myMidca.append_phase(phase) #add the modules which instantiate basic blocksworld operation myMidca.append_module("Simulate", simulator.MidcaActionSimulator()) myMidca.append_module("Simulate", simulator.ASCIIWorldViewer(display=DISPLAY_FUNC)) myMidca.append_module("Perceive", perceive.PerfectObserver()) myMidca.append_module("Interpret", note.ADistanceAnomalyNoter()) myMidca.append_module("Interpret", guide.UserGoalInput()) myMidca.append_module("Eval", evaluate.SimpleEval()) myMidca.append_module("Intend", intend.SimpleIntend()) myMidca.append_module( "Plan", planning.PyHopPlanner(util.mortar_pyhop_state_from_world, util.mortar_pyhop_tasks_from_goals, DECLARE_METHODS_FUNC, DECLARE_OPERATORS_FUNC, extinguish, mortar)) myMidca.append_module("Act", act.SimpleAct()) #myMidca.insert_module('Simulate', simulator.ArsonSimulator(arsonChance = 0.0, arsonStart = 10), 1) #myMidca.insert_module('Simulate', simulator.FireReset(), 0) myMidca.insert_module('Interpret', guide.SimpleMortarGoalGen(), 1) #myMidca.insert_module('Interpret', guide.TFFire(), 2) myMidca.insert_module('Interpret', guide.ReactiveApprehend(), 3) myMidca.insert_module(