home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume29 / persim / part01 / persim.h < prev    next >
Text File  |  1992-04-06  |  3KB  |  82 lines

  1. /*Copyright  (c)   1992  Adam  Stein.   All  Rights Reserved.   
  2.  
  3.   Permission to use,  copy,  modify  and  distribute  without
  4.   charge this software, documentation, images, etc. is grant-
  5.   ed, provided that this copyright and the author's  name  is  
  6.   retained.   
  7.   
  8.   A fee may be charged for this program ONLY to recover costs   
  9.   for distribution (i.e. media costs).  No profit can be made            
  10.   on this program.   
  11.    
  12.   The author assumes no responsibility for disasters (natural   
  13.   or otherwise) as a consequence of use of this software.      
  14.    
  15.   Adam Stein (stein.wbst129@xerox.com)         
  16. */ 
  17.  
  18. #define AMBIGUOUS -2                /*Ambiguous syntax*/
  19. #define UNKNOWN -1                /*Value is unknown*/
  20. #define VERSION_STR "v1.0 by Adam Stein"    /*Version string*/
  21.  
  22. /*Commands*/
  23. #define ALPHA        0        /*Alpha*/
  24. #define EXIT        1        /*Exit program*/
  25. #define HELP        2        /*Help*/
  26. #define INODES        3        /*Number of input nodes*/
  27. #define LOAD        4        /*Load variables from a file or stdin*/
  28. #define NODE        5        /*Node command*/
  29. #define ONODES        6        /*Number of output nodes*/
  30. #define RANGE        7        /*Range of something*/
  31. #define RUN        8        /*Run the simulator*/
  32. #define SAVE        9        /*Save variables to a file*/
  33. #define SHOW        10        /*Show the value of a variable*/
  34. #define TRAINING    11        /*Training mode toggle*/
  35. #define VERSION     12        /*Show version*/
  36.  
  37. #define NUM_CMDS    13        /*Number of commands available*/
  38.  
  39. /*Qualifiers*/
  40. #define ASCII        50        /*File is of type ASCII*/
  41. #define BINARY        51        /*File is of type binary (byte size)*/
  42. #define DESIRED        52        /*Operation involves desired output*/
  43. #define FUNCTION    53        /*Non-linearity function to use*/
  44. #define INPUT        54        /*Operation involves input data*/
  45. #define OUTPUT        55        /*Operation involves output data*/
  46. #define RANDOM        56        /*Load weights randomly*/
  47. #define STDIN        57        /*Read values from stdin*/
  48. #define SYS_VARS    58        /*Operation involves system variables*/
  49. #define THRESHOLD    59        /*Set node's threshold*/
  50. #define VERBOSE        60        /*Run in verbose mode*/
  51. #define WEIGHTS        61        /*Operation involves weight data*/
  52.  
  53. #define NUM_QUALIFIERS    12        /*Number of qualifiers*/
  54.  
  55. /*Command structure*/
  56. typedef struct _cmd {
  57.     int numargs;            /*Number of arguments for cmd*/
  58.     char *name;            /*Name of command*/
  59. } CMD;
  60.  
  61. /*Node information structure*/
  62. typedef struct _node_attr {
  63.     double threshold;        /*Node threshold*/
  64.     double (*func)();        /*Non-linear function*/
  65. } NODE_ATTR;
  66.  
  67. /*System variables structure*/
  68. typedef struct _state {
  69.     double alpha;            /*Alpha*/
  70.     int inodes;            /*Number of input nodes*/
  71.     int onodes;            /*Number of output nodes*/
  72.     int training;            /*Training mode status (on/off)*/
  73. } STATE;
  74.  
  75. /*Structure of file containing weight information*/
  76. typedef struct _weight {
  77.     int from;            /*From input node number*/
  78.     int to;                /*To output node number*/
  79.     double value;            /*Weight value*/
  80. } WEIGHT;
  81.  
  82.