-
Notifications
You must be signed in to change notification settings - Fork 0
/
FollowerEnvEnsemble.java
50 lines (40 loc) · 1.31 KB
/
FollowerEnvEnsemble.java
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
41
42
43
44
45
46
47
48
49
50
package ACC;
import cz.cuni.mff.d3s.deeco.annotations.KnowledgeExchange;
import cz.cuni.mff.d3s.deeco.annotations.Membership;
import cz.cuni.mff.d3s.deeco.annotations.In;
import cz.cuni.mff.d3s.deeco.annotations.Out;
import cz.cuni.mff.d3s.deeco.annotations.PeriodicScheduling;
import cz.cuni.mff.d3s.deeco.ensemble.Ensemble;
import cz.cuni.mff.d3s.deeco.knowledge.OutWrapper;
public class FollowerEnvEnsemble extends Ensemble {
@Membership
public static boolean membership(
@In("coord.fPos") Double fPos,
@In("coord.fSpeed") Double fSpeed,
@In("coord.fGas") Double fGas,
@In("coord.fBrake") Double fBrake,
@In("member.eFGas") Double eFGas,
@In("member.eFBrake") Double eFBrake,
@In("member.eFPos") Double eFPos,
@In("member.eFSpeed") Double eFSpeed
){
return true;
}
@KnowledgeExchange
@PeriodicScheduling(50)
public static void map(
@Out("coord.fPos") OutWrapper<Double> fPos,
@Out("coord.fSpeed") OutWrapper<Double> fSpeed,
@In("coord.fGas") Double fGas,
@In("coord.fBrake") Double fBrake,
@Out("member.eFGas") OutWrapper<Double> eFGas,
@Out("member.eFBrake") OutWrapper<Double> eFBrake,
@In("member.eFPos") Double eFPos,
@In("member.eFSpeed") Double eFSpeed
) {
eFGas.value = fGas;
eFBrake.value = fBrake;
fPos.value = eFPos;
fSpeed.value = eFSpeed;
}
}