Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/QNX4/Group5/constants.hpp

Go to the documentation of this file.
00001 #ifndef __J2K__Train__Constants_HPP__
00002 #define __J2K__Train__Constants_HPP__
00003 
00004 #define SIZE_OF_SECTOR 6
00005 #define NUMBER_OF_SWITCHES 4
00006 #define NUMBER_OF_TRAINS 3
00007 
00008 enum Direction { ANTICLOCKWISE, CLOCKWISE };
00009 enum SwitchStatus { CURVED, STRAIGHT };
00010 enum TrainStatus{ PARKED, MOVING, WAITING };
00011 
00012 enum SECTOR { A, B, C, D, E, F };
00013 
00014 enum SWITCH{ A, B, C, D };
00015 
00016 enum SUITATION{ SD2T, DD2T, SD3T, DD3T }; 
00017 
00018 // Sector, Dir
00019 const int WAITINGAREA[6][2] = {
00020   { 13, 14},
00021   { 11, 12 },
00022   {  5,  6 },
00023   {  3,  4 },
00024   { 16,  1 },
00025   {  8,  9 }
00026 };
00027 
00028 //[DIR][SECTOR][CHOICE]
00029 //-1 means you only have one choice and the second choice is not good
00030 const int SDNEXTSECTOR[2][6][2] = {
00031   {{F,-1},{F,-1},{E,-1},{E,-1},{A,B},{D,C}},
00032   {{E,-1},{E,-1},{F,-1},{F,-1},{D,C},{A,B}}
00033 };
00034 
00035 //TOLOCK[SECTOR][DIR] 
00036 //will give you the switch to curve. 
00037 const int TOLOCK[6][2] = {
00038   { -1, -1 },
00039   {  1,  1 },
00040   {  3,  2 },
00041   { -1, -1 },
00042   {  0,  3 },
00043   {  2,  3 }
00044 };
00045 
00046 const int CURRENTSECTOR[16] = { E, -1, D, D, C, C, -1, F,
00047                                 F, -1, B, B, A, A, -1, E };
00048 
00049 const int CURRENTSWITCH[4] = { };
00050 
00051 #endif

Generated on Sun Oct 14 18:46:42 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001