-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTesting.m
60 lines (55 loc) · 1.78 KB
/
Testing.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
close all;
clc;
workspace;
%% Run Parameters
PauseLength = 0.0;
NumberOfSheep = 20;
NumberOfSteps = 630 + 20 * NumberOfSheep;
SheepInitialCentreOfMass = [50 50];
SheepInitialRadius = 20;
SheepDogInitialOffsetFromSheepLocation = 20;
SheepVehicleSpeedLimit = 1.5;
SheepDogVehicleSpeedLimit = 2.0;
MaximumSafetyDistance = 0;
SheepDogBehaviourIndex = 9;
SheepBehaviourIndex = 4;
TargetSelectionIndex = 4;
DrivingCollectingPointsSafetyDistance = 1;
MinX = 0;
MaxX = 50;
MinY = 0;
MaxY = 50;
Boundary = [MinX,MaxX,MinY,MaxY];
CollisionRange = 0.4; %MaxX / 40.0;
CohesionRange = 30; %MaxX / 10.0;
AlignmentRange = MaxX / 10.0;
InfluenceRange = 65; MaxX / 10.0;
Ranges = [CohesionRange,AlignmentRange,CollisionRange,InfluenceRange];
WeightCollision = 2.0;
WeightCohesion = 1.05;
WeightAlignment = 0.0;
InfluenceOfDogWeight = 1.0;
WeightOfInertia = 0.5;
Weights = [WeightCohesion,WeightCollision,WeightAlignment,InfluenceOfDogWeight,WeightOfInertia];
GoalX = 10;
GoalY = 10;
GoalRadius = round(sqrt(NumberOfSheep),0);
Goal = [GoalX,GoalY,GoalRadius];
%% Implemented Sheepdog Behaviours
switch SheepDogBehaviourIndex
case 9
% Approaching the nearest neighbor
SheepDogBehaviorType = 'Strombom';
end
%% Sheep Behaviour
switch SheepBehaviourIndex
case 4
MotionType = 'flocking';
end
%% Target Selection Method
switch TargetSelectionIndex
case 4
TargetSelectionMethod = 'StrombomSelection';
end
%% Main Function Call
MultiSheepSingleSheepdog(NumberOfSteps,Goal,Ranges,Weights,Boundary,MotionType,NumberOfSheep,SheepVehicleSpeedLimit,SheepDogVehicleSpeedLimit,SheepDogBehaviorType,TargetSelectionMethod,MaximumSafetyDistance,DrivingCollectingPointsSafetyDistance,SheepDogInitialOffsetFromSheepLocation,PauseLength);