Something to get the mental juices flowing (an exercise in AI)

Started by
10 comments, last by TANSTAAFL 24 years, 7 months ago
ok. lately, i've been reading a book... "Artificial Intelligence: A Modern Approach", which i have found so far excellent.

anyway, while reading it, i came up with what i think is an interesting problem. i thought i'd share it with the group, and see what kind of ideas for how to implement such a scenario people came up with.

for simplicity, it deals with a 2 dimensional universe, with no gravity, no friction, but the usual laws of inertia apply. there is mass, length, and time, and the units we will use for them are Kilogram, meter, and second, although these are completely arbitrary names merely used for convention. we shall say that one frame=one second.

there are some objects in this universe.

each object has the following properties:

mass(remains constant for individual objects)
velocity(direction+speed)
acceleration(includes a direction)
position(an x,y coordinate)
spin(change in direction/second, measured in degrees)
torq(change in spin/second)

there are 3 such objects in this universe...

object#1: the Chunk.
this is a chunk of rock, but could be any piece of floating debris.
the chunk has spin(randomly set at the start of the simulation), velocity(also randomly set), a mass of 1000kg. it cannot accelerate or apply torque to itself on its own.

object#2: the Collector
this is essentially a bucket into which the chunk must be placed. for all intents and purposes it is stationary.(however, it MAY have a random spin and velocity). like the chunk, it cannot accelerate or torque itself. the mass is immaterial, but for sake of consistency, it masses 2000kg.

object#3: the TugBoat
the tugboat is the focus of this exercise, since it is the only agent that can perform actions. it masses 250kg. it starts at the same position as the collector, with the same velocity and spin as the collector(if any), and it has its landing claw on.

the landing claw of the tug will attach it to another object, thus allowing the tug to apply acceleration and torque to the object to which it is attached.

the landing claw can only be engaged(turned on) when the position and velocity of the tug and the object to which it is attaching are equal. also, the spin of both objects must be equal. the tug can only attach to one object at any time.

besides the landing claw, the tug has 4 other ways to affect its environment. these work in sets of two.

thrusters:
there are foreward and reverse thrusters. they accelerate the tug(and any attached object) in the direction in which the tug is facing, or the opposite direction, respectively. only one will fire at any time, and we represent 1 as being full forward, 0 as both off, and -1 as being full reverse.

the amount of force exerted by either thruster is 250 kg-m/s/s. this means (for the physics impaired), that it can accerate itself alone at 1 m/s/s. but if it had the chunk attached(making it a total mass of 1250, it would only accelerate (250 kg-m/s/s) / (1250 kg)= 0.2 m/s/s.

turning thrusters:
the tug also has two turning thrusters. a clockwise(starboard or right) and a counterclockwise(port or left). 1 represents pure clockwise turning, -1 pure counter clockwise turning, and 0 means no turning.

these apply torque to the tug and any attached object.

the amount of torque is 2500 kg-degrees/s/s. this means that the tug can torque itself by 10 degrees/s/s, but if it had the chunk attached, this would drop down to 2 degree/s/s.

sensors:
the tug has a number of sensors it can use to help with its task.

distance sensor:
the tug can look at any other objects and tell how far away it is from itself.

relative bearing sensor:
the tug can look at any other objects and tell which direction it lies, in relation to the tugs own direction... for example, if the tug was facing due west, and another object was due north of it, the tug would see it as 90 degrees clockwise from itself (i.e. 3o'clock)

relative spin sensor:
the tug can detect how fast another object is spinning. this sensor can only be used when the position and velocity of it and the object it is observing matches exactly.(i.e. the tug and the object must share the same axis of rotation) note: if the tug is currently rotating at 10 degrees/second, and the object it is observing is rotating at 15 degrees per second, it would see the object as rotating at 5 degrees per second.

now that we have laid out the rules, we can now state the goal of the scenario...

its simple: get the chunk to the collector, and make sure their spins match. when this occurs, the collector will automatically assimilate the chunk, making it a larger collector. then the tug must dock with the collector.

collision does not exist in this universe.

if there are any questions for clarification on this problem, just ask.

Get off my lawn!

Advertisement
What about the position the claw is attached to, if the claw is attached to the exact center on the collecter, and the exact center, of the chunk, it might work with your steps, but if the claw is attached off center, you will have some very messed up velocities,spins, and directions when it is released. Example: sandwich a golf ball between two frisbees and throw them. note what ball does when they separate. Same will happen with your tugboat. The instant it releases. it will be going in a straight line and its spin will be completely nullified.

This adds the concept of release time.

Step 1: sense where chunk is at times 1, 2, and 3
step 2: calculate where chunk will be at time X where X is a reasonable time based on its distance and heading.
Step 3: Calculate the time you must release claw to propell yourself towards this point.
Step 5: release claw at correct moment
Step 6: apply thrusters to modify direction such as to reach this point at the same time as chunk (at every time increment till chunk is reached
Step 7: when chunk is reached, attach to edge such that, forward/reverse thrusters are perpendicular to the line that passes through the center of mass of the the chunk (diameter if circular) at its furthest point from the center of mass. And side thrusters are along said line. This should make your forward and reverse thrusters be able to change the spin without causing changes to velocity, and your side thrusters to be able to change the velocity without changing the spin.
Step 8: remove spin , and turn chunk such that the center of mass, tugboats, side thrusters, and the collector are all in a straight line.
Step 9: accelerate till halfway from first point at which you moved towards the collecter till you reach the halfway point
( this removes the problem with reaching halway at a huge speed due to the fact you started moving towards it at further away than you started accelerating(movement of chunk away from collecter)). Then start to accelerate in the opposite direction till you reach a standstill at the point of the collecter
NOTE: cannot spin chunk from edge to match spin with the collecter, because the instant released it would change the spin of the chunk and fling the tugboat away again.
Step 10: release chunk, and reattach at the center of mass of the chunk
Step 11: spin chunk till it reaches spin of the collecter
Step 12: release chunk
Step 13: attach to the collecter

I think I stated the steps needed correctly?

------------------
Tell the truth and you will never fear someone will figure out you lied.
<<I'm sure I'm quoting someone out there, wish I knew who!>>
David Abresch

DESIGN FANATIC
David Abresch
abre1657@blue.univnorthco.edu

This topic is closed to new replies.

Advertisement