// CFG: TASK-MAP-EXPANDER-MAX-RUNS
$cfg->setConfigEntry('task_map_expander_max_runs', 0);
+// CFG: CITY-DAEMON-HOUSEHOLD-GROWTH-TASK-CLASS
+$cfg->setConfigEntry('city_daemon_household_growth_task_class', 'CityDaemonHouseholdGrowthTask');
+
+// CFG: TASK-HOUSEHOLD-GROWTH-STARTUP-DELAY
+$cfg->setConfigEntry('task_household_growth_startup_delay', 1000);
+
+// CFG: TASK-HOUSEHOLD-GROWTH-INTERVAL-DELAY
+$cfg->setConfigEntry('task_household_growth_interval_delay', 200);
+
+// CFG: TASK-HOUSEHOLD-GROWTH-MAX-RUNS
+$cfg->setConfigEntry('task_household_growth_max_runs', 0);
+
// [EOF]
?>
// Register it
$handlerInstance->registerTask('map_expander', $taskInstance);
+ // Prepare a household growth task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('city_daemon_household_growth_task_class');
+
+ // Register it
+ $handlerInstance->registerTask('household_growth', $taskInstance);
+
/*
* Add extra tasks depending on daemon modus.
*/
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A HouseholdGrowth city daemon-task
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CityDaemonHouseholdGrowthTask extends BaseTask implements Taskable, Visitable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $taskInstance An instance of a Visitable class
+ */
+ public final static function createCityDaemonHouseholdGrowthTask () {
+ // Get new instance
+ $taskInstance = new CityDaemonHouseholdGrowthTask();
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to process the visitor
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ * @todo Maybe visit some sub-objects
+ */
+ public function accept (Visitor $visitorInstance) {
+ // Visit this task
+ $visitorInstance->visitTask($this);
+ }
+
+ /**
+ * Executes the task
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function executeTask () {
+ $this->partialStub('Unimplemented task.');
+ }
+
+ /**
+ * Shuts down the task
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function doShutdown () {
+ self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...');
+ }
+}
+
+// [EOF]
+?>
-Subproject commit 15bab1114f3d4e33c67d035a7d3c20a8babeee81
+Subproject commit 925de61d0c6e97459a30df160ab88daeab74b795
The following tasks are used:
-----------------------------
-Name | Description
---------------+--------------------------------
- map_expander | Expands the city map if needed
---------------+--------------------------------
+ Name | Done | Description
+------------------+------+--------------------------------
+ map_expander | 0% | Expands the city map if needed
+ household_growth | 0% | Growths a single household
+------------------+------+--------------------------------
- - - - -
has reached or surpassed (to close, e.g. by constructing a long road) the map
is expanded (default: 10+100 from outer-most).
+- - - - -
+
+Task 'household_growth':
+------------------------
+
+The task is responsible for growing all households. The task checks if an empty
+zone is given and several pre-conditions are met:
+
+1) A road/path way is nearby (must be given but it will be checked anyway).
+
+2) The zone is not to small (minimum: 2x1 as 1 square must be given as distance
+ to the road. This however will be pre-checked by the client.
+
+3) The land value of the resitential zone is not to low (below zero) as this
+ hinders that people move in. Please note that some other zones (e.g.
+ landfills) may reduce land value around them).
+
+4) The land value is not to high for the citizen (cannot effort to buy the
+ zone).
+
+5) There is no initial "building" (e.g. hut) on the zone or the existing
+ building is a multi-household building and has at least one appartment for
+ sale. Please note that rich people prefer low-density and high land-value
+ zones over high-density zones except it is an expansive multi-household
+ building.
+
+The task also checks if an existing household has 2 adults of different gender
+(1 male, 1 female). Only under this condition reproduction is possible and a
+3rd person may be added to it (after about 260-280 days). Adoption is not yet
+simulated and may not be added. Please note that this is a city growth
+simulation and not a social simulation.
+
[EOF]