diff options
author | UbitUmarov | 2018-11-07 20:32:39 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-07 20:32:39 +0000 |
commit | ad8ddb8a781ae0da6780f74b91ebcaf338174569 (patch) | |
tree | 1df4035f0577ba29120b3c48bc0ffa6b15dbec40 /OpenSim/Region/Framework/Scenes/Prioritizer.cs | |
parent | change region gettexture response if presence not found (diff) | |
download | opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.zip opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.tar.gz opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.tar.bz2 opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.tar.xz |
changes to objects updates prioritizing getting dust on my disk. Schemes reduced to SimpleAngularDistance and BestAvatarResponsiveness
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 84 |
1 files changed, 4 insertions, 80 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 53ca849..cc4df17 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -33,27 +33,12 @@ using OpenSim.Framework; | |||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Region.PhysicsModules.SharedBase; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | 35 | ||
36 | /* | ||
37 | * Steps to add a new prioritization policy: | ||
38 | * | ||
39 | * - Add a new value to the UpdatePrioritizationSchemes enum. | ||
40 | * - Specify this new value in the [InterestManagement] section of your | ||
41 | * OpenSim.ini. The name in the config file must match the enum value name | ||
42 | * (although it is not case sensitive). | ||
43 | * - Write a new GetPriorityBy*() method in this class. | ||
44 | * - Add a new entry to the switch statement in GetUpdatePriority() that calls | ||
45 | * your method. | ||
46 | */ | ||
47 | |||
48 | namespace OpenSim.Region.Framework.Scenes | 36 | namespace OpenSim.Region.Framework.Scenes |
49 | { | 37 | { |
50 | public enum UpdatePrioritizationSchemes | 38 | public enum UpdatePrioritizationSchemes |
51 | { | 39 | { |
52 | Time = 0, | 40 | SimpleAngularDistance = 0, |
53 | Distance = 1, | 41 | BestAvatarResponsiveness = 1, |
54 | SimpleAngularDistance = 2, | ||
55 | FrontBack = 3, | ||
56 | BestAvatarResponsiveness = 4, | ||
57 | } | 42 | } |
58 | 43 | ||
59 | public class Prioritizer | 44 | public class Prioritizer |
@@ -68,14 +53,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
68 | } | 53 | } |
69 | 54 | ||
70 | /// <summary> | 55 | /// <summary> |
71 | /// Returns the priority queue into which the update should be placed. Updates within a | 56 | /// Returns the priority queue into which the update should be placed. |
72 | /// queue will be processed in arrival order. There are currently 12 priority queues | ||
73 | /// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained | ||
74 | /// for avatar updates. The fair queuing discipline for processing the priority queues | ||
75 | /// assumes that the number of entities in each priority queues increases exponentially. | ||
76 | /// So for example... if queue 1 contains all updates within 10m of the avatar or camera | ||
77 | /// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number | ||
78 | /// of updates. | ||
79 | /// </summary> | 57 | /// </summary> |
80 | public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) | 58 | public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) |
81 | { | 59 | { |
@@ -94,22 +72,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
94 | 72 | ||
95 | switch (m_scene.UpdatePrioritizationScheme) | 73 | switch (m_scene.UpdatePrioritizationScheme) |
96 | { | 74 | { |
97 | /* | ||
98 | case UpdatePrioritizationSchemes.Time: | ||
99 | priority = GetPriorityByTime(client, entity); | ||
100 | break; | ||
101 | case UpdatePrioritizationSchemes.Distance: | ||
102 | priority = GetPriorityByDistance(client, entity); | ||
103 | break; | ||
104 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | ||
105 | priority = GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance | ||
106 | break; | ||
107 | case UpdatePrioritizationSchemes.FrontBack: | ||
108 | priority = GetPriorityByFrontBack(client, entity); | ||
109 | break; | ||
110 | */ | ||
111 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | 75 | case UpdatePrioritizationSchemes.SimpleAngularDistance: |
112 | priority = GetPriorityByAngularDistance(client, entity); // TODO: Reimplement SimpleAngularDistance | 76 | priority = GetPriorityByAngularDistance(client, entity); |
113 | break; | 77 | break; |
114 | case UpdatePrioritizationSchemes.BestAvatarResponsiveness: | 78 | case UpdatePrioritizationSchemes.BestAvatarResponsiveness: |
115 | default: | 79 | default: |
@@ -120,45 +84,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
120 | return priority; | 84 | return priority; |
121 | } | 85 | } |
122 | 86 | ||
123 | private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity) | ||
124 | { | ||
125 | // And anything attached to this avatar gets top priority as well | ||
126 | if (entity is SceneObjectPart) | ||
127 | { | ||
128 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
129 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
130 | return 1; | ||
131 | } | ||
132 | |||
133 | return PriorityQueue.NumberOfImmediateQueues; // first queue past the immediate queues | ||
134 | } | ||
135 | |||
136 | private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity) | ||
137 | { | ||
138 | // And anything attached to this avatar gets top priority as well | ||
139 | if (entity is SceneObjectPart) | ||
140 | { | ||
141 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
142 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
143 | return 1; | ||
144 | } | ||
145 | |||
146 | return ComputeDistancePriority(client,entity,false); | ||
147 | } | ||
148 | |||
149 | private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) | ||
150 | { | ||
151 | // And anything attached to this avatar gets top priority as well | ||
152 | if (entity is SceneObjectPart) | ||
153 | { | ||
154 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
155 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
156 | return 1; | ||
157 | } | ||
158 | |||
159 | return ComputeDistancePriority(client,entity,true); | ||
160 | } | ||
161 | |||
162 | private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) | 87 | private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) |
163 | { | 88 | { |
164 | uint pqueue = 2; // keep compiler happy | 89 | uint pqueue = 2; // keep compiler happy |
@@ -176,7 +101,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
176 | // Attachments are high priority, | 101 | // Attachments are high priority, |
177 | if (sog.IsAttachment) | 102 | if (sog.IsAttachment) |
178 | return 2; | 103 | return 2; |
179 | |||
180 | 104 | ||
181 | if(presence.ParentPart != null) | 105 | if(presence.ParentPart != null) |
182 | { | 106 | { |