主要内容

getActionInfo

Obtain action data specifications from reinforcement learning environment or agent

Description

example

actInfo= getActioninfo(env)extracts action information from reinforcement learning environmentenv.

actInfo= getActioninfo(agent)extracts action information from reinforcement learning agentagent.

Examples

collapse all

Extract action and observation information that you can use to create other environments or agents.

增强学习环境for this example is the simple longitudinal dynamics for ego car and lead car. The training goal is to make the ego car travel at a set velocity while maintaining a safe distance from lead car by controlling longitudinal acceleration (and braking). This example uses the same vehicle model as the使用模型预测控制的自适应巡航控制系统(Model Predictive Control Toolbox)example.

Open the model and create the reinforcement learning environment.

mdl ='rlACCMdl'; open_system(mdl); agentblk = [mdl'/RL Agent'];% create the observation infoobsinfo = rlnumericspec([3 1],,'LowerLimit',-inf*ones(3,1),'UpperLimit',inf*ones(3,1)); obsInfo.Name ='observations'; obsInfo.Description ='information on velocity error and ego velocity';% action InfoactInfo = rlNumericSpec([1 1],'LowerLimit',-3,'UpperLimit',2); actInfo.Name =“加速”;%定义环境env = rlSimulinkEnv(mdl,agentblk,obsInfo,actInfo)
env = SimulinkEnvWithAgent with properties: Model : rlACCMdl AgentBlock : rlACCMdl/RL Agent ResetFcn : [] UseFastRestart : on

增强学习环境envis a金宝appsimulinkwithagent具有上述属性的对象。

Extract the action and observation information from the reinforcement learning environmentenv.

actInfoExt = getActionInfo(env)
actInfoExt = rlNumericSpec with properties: LowerLimit: -3 UpperLimit: 2 Name: "acceleration" Description: [0x0 string] Dimension: [1 1] DataType: "double"
obsInfoExt = getObservationInfo(env)
obsinfoext = rlnumericspec具有属性:下限:[3x1 double]上限:[3x1 double]名称:“观察”描述:“有关速度错误和自我速度的信息”,“尺寸:[3 1] datatype:[3 1] datatype:“ double”“ double”“

操作正ormation contains acceleration values while the observation information contains the velocity and velocity error values of the ego vehicle.

Input Arguments

collapse all

Reinforcement learning environment from which to extract the action information, specified as one of the following:

For more information on reinforcement learning environments, seeCreate MATLAB Reinforcement Learning Environments创建Simul金宝appink增强学习环境.

从中提取动作信息的强化学习代理,该信息指定为以下对象之一。

有关强化学习代理的更多信息,请参阅Reinforcement Learning Agents.

Output Arguments

collapse all

Action data specifications extracted from the reinforcement learning environment, returned as an array of one of the following:

Version History

Introduced in R2019a