-
Notifications
You must be signed in to change notification settings - Fork 2
/
task.m
41 lines (32 loc) · 954 Bytes
/
task.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
classdef task < matlab.mixin.Copyable
properties
id = 1;
task_function;
goal_position = [];
func
end
properties (Constant)
alpha = 0.8;
delta = 0.5;
end
methods
function obj = task(id, task_function, goal_position)
if nargin < 3 || isempty(goal_position)
goal_position = [];
end
obj.id = id;
obj.task_function = task_function;
obj.goal_position = goal_position;
end
function value = funcval(obj, position)
if ~isempty(obj.goal_position)
value = obj.task_function.f(position, obj.goal_position);
else
value = obj.task_function.f(position);
end
end
function f = get.func(obj)
f = obj.task_function;
end
end
end