Difference between revisions of "Circulation"

From Robowiki
Jump to navigation Jump to search
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
I wanted to apply some of my schooling to robocode and come up with what I thought was a novel idea, so in the last couple of my bots, I've implemented "circulation" and "rate of circulation" which I have learnt from Calculus III: Vector Calculus. - [[px]]
 
 
----
 
 
'''Basics'''
 
'''Basics'''
  
For our intents and purposes, circulation is a scalar quantity representing the path of a point in a vector field around another point, or in our case, a target tank around our bot. This value can be used to tell us in what direction the target bot is travelling no matter its heading, and how fast it is circling our bot.
+
For our intents and purposes, circulation is a scalar quantity representing the path of a target bot around our bot. This value can be used to tell us in what direction the target bot is travelling no matter its heading, and how fast it is circling our bot.
  
 
For example, the target can have a positive velocity, and is circling you in a clockwise direction, circulation will be a positive number. Now, if the target changes direction (ie, velocity is negative) but is STILL circling you in a clockwise direction, the circulation will still be positive.
 
For example, the target can have a positive velocity, and is circling you in a clockwise direction, circulation will be a positive number. Now, if the target changes direction (ie, velocity is negative) but is STILL circling you in a clockwise direction, the circulation will still be positive.
Line 11: Line 8:
 
'''Calculation'''
 
'''Calculation'''
  
Circulation is equal to the dot product of the target's velocity and a circulating vector field around our bot. This equation can be used to determine the value:
+
Circulation is equal to the dot product of the target's velocity and a circulating vector field around our bot. After simplifying the expression, this equation can be used to determine the value:
  
 
  circulation = dX*cos(theta) - dY*sin(theta)
 
  circulation = dX*cos(theta) - dY*sin(theta)
Line 23: Line 20:
 
'''Specific uses'''
 
'''Specific uses'''
  
> determine whether target is travelling clockwise or couter-clockwise
+
> determine whether target is circling clockwise or counter-clockwise
  
 
> determine whether or not a bot travels in circular paths around you
 
> determine whether or not a bot travels in circular paths around you
  
> keep track of direction changes and "time since last change"
+
> keep track of direction changes independant from target's velocity(+/-)
 +
 
 +
> used as a segment in advanced targeting ([[segmentation]])
  
 
> other uses?  please contribute...
 
> other uses?  please contribute...
Line 34: Line 33:
 
'''Notes'''
 
'''Notes'''
  
positive circulation = clockwise
+
> positive circulation = clockwise
 +
 
 +
> negative circulation = counter-clockwise
 +
 
 +
> zero circulation = target is not moving, or is travelling directly towards or away from you
  
negative circulation = counter-clockwise
+
> Circulation is actually a scalar number representing to what extent a vector is following a vector field. A value of zero is produced when the vector is perpendicular to the field
  
zero circulation = target is not moving, or is travelling directly towards or away from you
+
[[Category:Robocode Theory]]

Latest revision as of 14:35, 10 August 2017

Basics

For our intents and purposes, circulation is a scalar quantity representing the path of a target bot around our bot. This value can be used to tell us in what direction the target bot is travelling no matter its heading, and how fast it is circling our bot.

For example, the target can have a positive velocity, and is circling you in a clockwise direction, circulation will be a positive number. Now, if the target changes direction (ie, velocity is negative) but is STILL circling you in a clockwise direction, the circulation will still be positive.


Calculation

Circulation is equal to the dot product of the target's velocity and a circulating vector field around our bot. After simplifying the expression, this equation can be used to determine the value:

circulation = dX*cos(theta) - dY*sin(theta)

This equation assumes that your bot is at the centre of a perfectly circular vector field where,

theta = angle towards target bot, dX = target bot's x displacement, dY = target bot's y displacement


Specific uses

> determine whether target is circling clockwise or counter-clockwise

> determine whether or not a bot travels in circular paths around you

> keep track of direction changes independant from target's velocity(+/-)

> used as a segment in advanced targeting (segmentation)

> other uses? please contribute...


Notes

> positive circulation = clockwise

> negative circulation = counter-clockwise

> zero circulation = target is not moving, or is travelling directly towards or away from you

> Circulation is actually a scalar number representing to what extent a vector is following a vector field. A value of zero is produced when the vector is perpendicular to the field