Class RouteList

java.lang.Object
  extended by RouteList

 class RouteList
extends java.lang.Object

"RouteList" is a singly linked list class. It uses the 'node' class for items in the list.


Field Summary
(package private)  RouteNode[] array
           
(package private)  int length
           
(package private)  RouteNode start
           
 
Constructor Summary
RouteList()
           
 
Method Summary
(package private)  boolean anneal(double temp, int nlimit, int glimit, boolean fix_ends)
          "anneal( double, int, int, boolean )" performs the simulated annealing algorithm.
(package private)  RouteList duplicate()
          "duplicate()" creates a copy of this linked list
(package private)  RouteNode get_item(int i)
          "get_item( int )" finds the indexed item in the list.
(package private)  int get_length()
          "get_length" is for access to length of list.
(package private)  double get_route_length()
          "get_route_length()" computes the total path length for the list
(package private)  void init_llist()
          "init_llist()" creates an array for fast lookup of nodes.
(package private)  void insert(int x, int y, int i)
          "insert( int, int, int )" appends a new node to the list.
(package private) static int randint(int beg, int end)
          "randint( int, int )" generate a random integer in the range [beg...end]
(package private)  void replace(RouteList from)
          "replace( llist )" copies another list into this linked list
(package private)  void swap(int i1, int i2)
          "swap( int, int )" exchanges two items in the list by swapping values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

RouteNode start

length

int length

array

RouteNode[] array
Constructor Detail

RouteList

RouteList()
Method Detail

get_item

RouteNode get_item(int i)
"get_item( int )" finds the indexed item in the list.

Returns:
pointer to list item

init_llist

void init_llist()
"init_llist()" creates an array for fast lookup of nodes.


get_length

int get_length()
"get_length" is for access to length of list.

Returns:
the length of the list

insert

void insert(int x,
            int y,
            int i)
"insert( int, int, int )" appends a new node to the list.


duplicate

RouteList duplicate()
"duplicate()" creates a copy of this linked list

Returns:
pointer to new list

replace

void replace(RouteList from)
"replace( llist )" copies another list into this linked list


swap

void swap(int i1,
          int i2)
"swap( int, int )" exchanges two items in the list by swapping values. This requires no complex decision logic.


randint

static int randint(int beg,
                   int end)
"randint( int, int )" generate a random integer in the range [beg...end]

Returns:
nothing

anneal

boolean anneal(double temp,
               int nlimit,
               int glimit,
               boolean fix_ends)
"anneal( double, int, int, boolean )" performs the simulated annealing algorithm.

Returns:
true if improvement made, else false

get_route_length

double get_route_length()
"get_route_length()" computes the total path length for the list

Returns:
path length