function a = init_action(id, policy, varargin)
% an action consists of an id, a low-level control policy,
% a termination condition, and an absolute maximum duration.
% Note that a duration can also be encoded using a simple
% termination condition that checks the state time. 

a.id = id;
a.policy = policy;

if nargin > 2
  a.termination = varargin{1};
else
  % by default action terminates after 1 second
  a.termination = @(world_state, P)final_time_termination(world_state, 1, P);
end
