Difference between revisions of "New tie paradigm"

From WikiManual
Jump to: navigation, search
(Commands)
(Sysvars)
Line 26: Line 26:
 
*currtie - The value that settie is set to.  A read sysvar.
 
*currtie - The value that settie is set to.  A read sysvar.
  
*setK - A read/write sysvar, set to the present spring coefficient.  Overwrite and set the spring coefficient of the current tie to a new value (and pay the difference in potential energy).
+
*tieK - A read/write sysvar, set to the present spring coefficient.  Overwrite and set the spring coefficient of the current tie to a new value (and pay the difference in potential energy).
  
*setB - A read/write sysvar, set to the present damping constant.  Overwrite and set the damping constant of the current tie to a new value.(and pay the difference in potential energy).
+
*tieB - A read/write sysvar, set to the present damping constant.  Overwrite and set the damping constant of the current tie to a new value.(and pay the difference in potential energy).
  
 
*tietype - Set the kind of constraints the tie uses.  example:
 
*tietype - Set the kind of constraints the tie uses.  example:

Revision as of 18:42, 14 April 2006

For the C++ version (2.5), all old tie sysvars are thrown out. Here's the comprehensive list of all the new tie commands and sysvars:

Commands

  • readtie - If settie is set (ie: not 0) writetie takes 1 value from the stack, representing the memory location to be read from, and places a value on the stack representing the value at that location through the tie. If settie is positive, and points to a phase representing more than one tie, the returned values are averaged for each robot thus pointed to.
.nrg readtie will read the value stored in .nrg from the bot connected through the current tie.
  • writetie - If settie is set (ie: not 0) writetie takes 2 values from the stack. 10 .up writetie will place 10 at the location specified (.up) in whichever bots are at the other end of the tie(s) settie addresses.
When settie isn't set, writetie removes an extra value from the stack to represent the tie being pointed to. ie: -1 10 .up writetie to write to tie -1.
If a negative memory location is specified (ie: 10 -1 writetie) substance transfer is initiated. 10 -1 writetie would transfer 10 units of energy from the tie being pointed to. If settie is unset, this vesion also takes an additional value form the stack.
  • settie - Sets the current tie that the DNA is looking at. When a new tie is set, all the sysvars update for the new information from that tie. Negative nubmers specify a physical tie in the internal array. Positive numbers specifies a tie phase. Multiple ties can be addressed through a single tie phase.
  • nexttie - settie's to the next tie. If settie is currently set to negative (ie: internal arrays) it finds the next tie in the internal array. If the present tie is already at the end, it moves back to the beginning. If the present tie is positive, nexttie finds the next valid tie phase, looping back to the lowest tie phase if it's already at the highest. If settie is unset (ie: set to 0) nexttie pushes it to first internal tie (ie: a negative).

Sysvars

  • readtielen - A read sysvar. Reads back the length of the current tie.
  • writetielen - A read/write sysvar. reads back the ties natural length. If this value is overwritten, the ties natural length is set to the new value.
  • tieangle - A read sysvar. Reads back the relative angle of the tie with respect to the bot's eye.
  • tie - Attempts to form a tie with the specified phase. Since phases are limited to [1, 200], a value greater than 200 will be modded by 200. A negative value's sign will be flipped then modded 200.
  • deltie - If settie is set and the number stored is non negative, the current tie(s) selected are deleted. If settie is not set, the tie phase (positive values) or tie index (negative values) matching the value is deleted.
  • currtie - The value that settie is set to. A read sysvar.
  • tieK - A read/write sysvar, set to the present spring coefficient. Overwrite and set the spring coefficient of the current tie to a new value (and pay the difference in potential energy).
  • tieB - A read/write sysvar, set to the present damping constant. Overwrite and set the damping constant of the current tie to a new value.(and pay the difference in potential energy).
  • tietype - Set the kind of constraints the tie uses. example:
    1. - Spring (apply a damped spring force)
    2. - Rope (offer no resistance until the natural length is reached, then create infinite resistance)
    3. - Repulsor (offer no resistance as long as length is greater than the natural length. If the length is less than the natural length, create an infinite repulsive force).
    4. - Rod - keep the ties length exactly at the natural length using constraints. Will basically be like a rigid rod is connecting the bots, making the bots into a rigid body.
  • numties - Returns the number of phsyical ties connected to the bot.
  • birthtietype - Similar to tietype, sets the type of tie that birth ties turn into when they harden. If 0 is specified, birth ties atrophy after 100 cycles.

Tie Notes

  • Ports - The internal array index is referred to as a tie's "port". Each tie has a unique port. Each port may or may not have a tie. Port ranges are set by the number of ties in existance when a new tie is formed. Ties always fill in the first gap in the internal tie array.
  • Phase - The phase of a tie is a way of addressing multiple ties at once. Each tie has a unique phase. Phases may exist anywhere in the mod range [1,200]. That is, 1 = 201 = 401.
  • Length - Max tie length will be 1000, after which all ties become 100% rigid and acts like a stiff rod. This includes birth ties. A later feature will be that the max tie length is a function of the amount of material (nrg) used in its construction. Ties' diameter will stretch and shrink as the tie does. Ties won't be allowed to go below a certain diameter. This diameter will also effect the bandwidth (that is, the max throughput) allowed in sharing/stealing substances.
  • Birth Ties - Spring ties that after 100 cycles die off or harden depending on the value set on birthtietype. Birth ties are only formed between a mother and child bot at the moment of reproduction.