Source for file Simulator.php

Documentation is available at Simulator.php

  1. <?php
  2. /**
  3. * FIT Fixture
  4. *
  5. * $Id$
  6. *
  7. * @author Luis A. Floreani <luis.floreani@gmail.com>
  8. * @author gERD Schaufelberger <gerd@php-tools.net>
  9. * @package FIT
  10. * @subpackage Fixture
  11. * @license LGPL http://www.gnu.org/copyleft/lesser.html
  12. * @copyright Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
  13. */
  14. /**
  15. * FIT Fixture
  16. *
  17. * @version 0.1.0
  18. * @package FIT
  19. * @subpackage Fixture
  20. */
  21. class Simulator extends ActionFixture {
  22.  
  23. /**
  24. * dictionary of variable types
  25. * @var int
  26. */
  27. protected $typeDict = array(
  28. 'nodes' => 'integer',
  29. 'zip' => 'integer',
  30. 'coord' => 'string'
  31. );
  32.  
  33. /**
  34. * counts current nodes
  35. * @var int
  36. */
  37. public $nodes = 0;
  38. /**
  39. * zip code
  40. * @var string
  41. */
  42. public $zip;
  43. /**
  44. * geo coordinates
  45. * @var object
  46. */
  47. public $coord;
  48. /**
  49. * new City
  50. *
  51. * @return void
  52. */
  53. public function newCity() {
  54. echo "net.Simulator->". __FUNCTION__ ."() \n";
  55. }
  56. /**
  57. * ok
  58. *
  59. * @return void
  60. */
  61. public function ok() {
  62. echo "net.Simulator->". __FUNCTION__ ."() \n";
  63. ++$this->nodes;
  64. }
  65. /**
  66. * nodes
  67. *
  68. * @return void
  69. */
  70. public function cancel() {
  71. echo "net.Simulator->". __FUNCTION__ ."() \n";
  72. }
  73. /**
  74. * name
  75. *
  76. * @return void
  77. */
  78. public function name( $n ) {
  79. echo "net.Simulator->". __FUNCTION__ ."() \n";
  80. }
  81. /**
  82. * zip
  83. *
  84. * Update current zip or receive zip
  85. *
  86. * @return void or current zip
  87. */
  88. public function zip( $z = null ) {
  89. echo "net.Simulator->". __FUNCTION__ ."() \n";
  90. if( $z == null ) {
  91. return $this->zip;
  92. }
  93. $this->zip = $z;
  94. }
  95. /**
  96. * population
  97. *
  98. * @return void
  99. */
  100. public function population( $p ) {
  101. echo "net.Simulator->". __FUNCTION__ ."() \n";
  102. }
  103. /**
  104. * coord
  105. *
  106. * @return void
  107. */
  108. public function coord( $c = null ) {
  109. echo "net.Simulator->". __FUNCTION__ ."() \n";
  110. if( $c == null ) {
  111. return $this->geo;
  112. }
  113. $this->geo = $c;
  114. }
  115. /**
  116. * nodes
  117. *
  118. * @return void
  119. */
  120. public function nodes() {
  121. echo "net.Simulator->". __FUNCTION__ ."() \n";
  122. return $this->nodes;
  123. }
  124. /*
  125. public Object parse (String string, Class type) throws Exception {
  126. if (type.equals(GeoCoordinate.class)) {return GeoCoordinate.parse(string);}
  127. return super.parse (string, type);
  128. }
  129. */
  130. }

Documentation generated on Sun, 02 Apr 2006 16:01:06 +0200 by phpDocumentor 1.3.0RC5