1 package org.opentrafficsim.road.gtu.lane.perception.mental.sdm;
2
3 import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
4 import org.opentrafficsim.road.gtu.lane.perception.mental.ConstantTask;
5 import org.opentrafficsim.road.gtu.lane.perception.mental.Task;
6
7
8
9
10
11
12
13
14
15
16
17 @FunctionalInterface
18 public interface TaskSupplier
19 {
20
21
22
23
24
25
26 Task getTask(LaneBasedGtu gtu);
27
28
29
30
31 class Constant implements TaskSupplier
32 {
33
34 private final String id;
35
36
37 private final double taskDemand;
38
39
40
41
42
43
44 public Constant(final String id, final double taskDemand)
45 {
46 this.id = id;
47 this.taskDemand = taskDemand;
48 }
49
50
51 @Override
52 public Task getTask(final LaneBasedGtu gtu)
53 {
54 return new ConstantTask(this.id, this.taskDemand);
55 }
56 }
57
58 }