def __init__(self, params_filename=None): """ Creates an agent that performs a stern conversion against a target aircraft. A new StateAgent is initialised with the states in this module. The tactical parameters for each state may be set using a json file. Args: params_filename (string): optional json file containing tactical parameters to overwrite the default state parameters Returns: (StateAgent): stern conversion state agent """ states = [EcuPureIntercept(), EcuFlyRelativeBearing(), EcuFlyingOffset(), EcuConverting(), EcuMatchAltitude()] # # Pre-fill tactical parameters if json file is defined # if params_filename: # with open(params_filename) as data_file: # data = json.load(data_file) # for state in states: # state_classname = state.__class__.__name__ # if state_classname in data: # # Set parameters to the values defined in the json file # for param, value in data[state_classname].items(): # setattr(state, param, value) StateAgent.__init__(self, states, initial=[EcuPureIntercept, EcuMatchAltitude])
def __init__(self, params_filename=None): """ Creates an agent that performs basic air flight maneuvers based on the Park agent paper. A new StateAgent is initialised with the states in this module. The transition parameters are set from a specified JSON file. Args: params_filename (string): optional json file containing tactical parameters to overwrite the default transition parameters Returns: (StateAgent): basic state agent """ states = [LeftDown(), LeftUp(), PullUp(), LevelFlight(), PushDown(), RightUp(), RightDown()] # Pre-fill tactical parameters if json file is defined # if params_filename: # with open(params_filename) as data_file: # data = json.load(data_file) # for state in states: # state_classname = state.__class__.__name__ # if state_classname in data: # # Set parameters to the values defined in the json file # for param, value in data[state_classname].items(): # setattr(state, param, value) StateAgent.__init__(self, states, initial=[LeftUp])
def __init__(self, params_filename=None): """ Creates an agent that performs a stern conversion against a target aircraft. A new StateAgent is initialised with the states in this module. The tactical parameters for each state may be set using a json file. Args: params_filename (string): optional json file containing tactical parameters to overwrite the default state parameters Returns: (StateAgent): stern conversion state agent """ states = [PureIntercept(), MatchAltitude(), MatchSpeed()] StateAgent.__init__(self, states, initial=[PureIntercept, MatchAltitude, MatchSpeed])
def __init__(self, params_filename=None): """ Creates an agent that performs a stern conversion against a target aircraft. A new StateAgent is initialised with the states in this module. The tactical parameters for each state may be set using a json file. Args: params_filename (string): optional json file containing tactical parameters to overwrite the default state parameters Returns: (StateAgent): stern conversion state agent """ states = [ LeftDown(), LeftUp(), PullUp(), LevelFlight(), PushDown(), RightUp(), RightDown() ] # Pre-fill tactical parameters if json file is defined if params_filename: with open(params_filename) as data_file: data = json.load(data_file) for state in states: state_classname = state.__class__.__name__ if state_classname in data: # Set parameters to the values defined in the json file for param, value in data[state_classname].items(): setattr(state, param, value) StateAgent.__init__(self, states, initial=[LeftDown])