How to add "algorithm_new" to ad_hoc_calculator:

1.  add a prototype to the class definition in ac_Calculator.h.


class ac_Calculator : public mt_Calculator
{
  private:
  ac_RouteAlgorithm algorithm;
  int algorithm_8x8 (mt_Node*h1, mt_Node*h2, mt_Route*route);
  int algorithm_new (mt_Node*h1, mt_Node*h2, mt_Route*route);   <-----------


2. add an algorithm argument to usage() in ac_Calculator.c

void ac_Calculator::usage ()
{
  printFormat
    (
     "route-args:\n"
     "-8x8\n"
     "-new\n"  <----------
     );
}

3. add the code to parse the argument in parseArgs() in ac_Calculator.c

    if (!strcmp (argv [i], "-8x8"))
    {
      algorithm = mt_fp (algorithm_8x8);
    }
    else if (!strcmp (argv [i], "-new"))     \
    {                                         \------------------
      algorithm = mt_fp (algorithm_new);      /
    }                                        /

4. add the new algorith to ac_Calculator.c
   -use algorithm_8x8 as an example.
   -use insist () statements.
   -put the switches of the route in the array switches[].
   -return number of switches in route, or -1 if error.   
   -use the function getSwitch (int x, int y) to get a pointer
    to switch_x_y.
    for example: mt_Node*s = getSwitch (0,1);
   -use the functions getX() and getY() to get the x and y of a switch.
    for example int x = s->getX ();
   -use function getRoute () to convert an array of switches into a
    route (for mesh calculators)

int ac_Calculator::algorithm_new (mt_Node*h1, mt_Node*h2, mt_Route*route)
{
}


4. make in mt/mesh_calculator directory
5. make in mt/tools directory

6. test the new algorithm by calling
   mt/tools/sparc_solaris/ad_hoc_routes in.map stdout -route-args -new
