A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Raptor problem #2

  1. #1
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927

    Raptor problem #2

    here. for the sake of discussion, we have (let's take seemingly missing data from problem #1):

    raptors attack accelerating at 4 m/s^2 up to their top speed of 25 m/s. you're at the center of equilateral triangle with a raptor at each corner. the top raptor has a wounded leg and is limited to a top speed of 10 m/s. you begin to flee, quickly (1) reaching your top speed of 6 m/s. the raptor will run towards you. at what angle (2) you should run to maximize the time you stay alive?

    three problems with that is (1) what does "quickly" mean (∞ m/s^2 ?), then (2) who said that straight line is the optimal route to take, and (3) should everyone keep running at their top speed once it was reached?

    how would you go about solving this problem? I am tempted to write simple "genetic" solver based on brute-force simulation.
    who is this? a word of friendly advice: FFS stop using AS2

  2. #2
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246
    i think it's a really complicated problem because how the raptors react and accelerate toward your changes in movement is hard to define. but if you assume that they don't lose speed on changing direction there might be an analytical way of solving it. i think it might be a type of quadratic programming problem? where you have to maximize a convex set given certain constraints.

    if you picture this geometrically, where rn is a raptor, r1 is the injured one and x is you:
    PHP Code:
        r1

         x

    r2      r3 
    the solution is the point q where the graphs of r1, x and r3 (or r2, it doesn't matter) intersect that yields the greatest area of the set { r1, x, r3, q }.

    if x, r1 and r3 abstract the position, velocity and accelerations of each element you're trying to maximize the function f(x, r1, r3) subject to the constraints that ||x vel|| <= 6 m/s, ||r1 vel|| <= 10 m/s and ||r3 vel|| <= 25 m/s.

    but i'm just guessing! i don't really know, but i'm curious how you end up solving it!

    also, my intuition tells me that the deviation you should run from the path perpendicular to the line segment (r1,r3) is equivalent to the ratio of the raptors' relative maximum speeds....
    Last edited by newblack; 07-04-2009 at 03:52 PM.

  3. #3
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    the solution is the point q where the graphs of r1, x and r3 (or r2, it doesn't matter) intersect that yields the greatest area of the set { r1, x, r3, q }
    imagine injured raptor totally disabled (v1 = 0) then solution would be q on (x-r2)+(x-r3) line, or r1-x line actually, as long as q != r1, which does not maximize that area; that also suggests that solution must depend on velocities... even if we throw out initial acceleration to simplify whole thing a bit, it is not quite easy to solve.
    who is this? a word of friendly advice: FFS stop using AS2

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center