The bottom layer describes the environmental composition of an artificial society, including the coverage of security facilities, fire protection facilities, transportation facilities, emergency facilities, and residential facilities. The middle layer is the artificial social geospatial information model, which mainly establishes the cell coordinate system, the grid coordinate system and the street coordinate system for the geospatial coordinates to determine the spatial position of each agent. The street system is the township-level administrative region of mainland China, and the grid system is that of the Municipal Planning Bureau, which relies on information technology and follows relevant national, industry and local standards to implement the grid division of the entire city in improve the level and efficiency of urban management. The grid, which can promote the in-depth development and information construction of urban grid management, contains numerous cells with a size of 50 × 50 square meters each. The cell includes environmental attributes and the families and residents that live in the area. The top layer is the individual agents and organizational agents in the artificial society and the relationships among the various types of agents, and it includes various elements of livable cities.
4.1. The ULC-AS Overview
4.1.1. Architecture
The ULC-AS architecture has four parts: preprocessing, model initialization, artificial society, and data management, as shown in
Figure 5. The preprocessing portion contains two parts, the agent model and the initial data processing, thus providing operational agents for the model initialization and multidimensional data information. The model initialization part includes the initial configuration of the agent and the loading of the space environment. The content of the initial configuration of the agent includes the attributes, behavior, type, quantity, order and relationship of the agent. The main function of the space environment loading is to import the processed data into the model as the operating environment of the agent. The artificial society part includes the agent, space environment and model control unit. The agent and space environment are the basic components of the artificial society. The function of the model control unit is to control the normal operation of the system, including agent scheduling, clock control, environmental control, state control, I/O (input/output) control, parameter control and scenario simulation. The data management part can extract data, perform a statistical analysis and provide a visual display of a large number of dynamically changing map data, population data and key parameters. The latest data are used as a variable in the next run of the model and are the basis for information feedback and adjustment in the artificial society. The above four parts form a complete ULC-AS architecture.
The core of the ULC-AS is the information interaction between agents and the interaction between agents and the environment. Different types of agents and different individual agents are linked by information transfer and through their respective operational rules, thus realizing the decision-making behavior and interaction of the agent. The interaction between the agent and space environment is not only the driving factor for changes in urban livability and residents’ satisfaction but is also the result of these changes. The information obtained by the agent provides a reference for its decision-making, which affects the livability level of the corresponding location, and the change in the livability level of the corresponding location affects the resident satisfaction of the agent in the next round. In this way, the interaction between agents and the interaction between the agents and the space environment constitute a complex space-time evolution system. The regularity that the system exhibits during its evolution is a true reflection of the evolution of the simulated objects.
4.1.2. Model Processes
The operational rules for the ULC-AS are designed as follows. (1) Different geographical locations show different security livability levels due to differences in their resource environments and building types and scales. (2) Residents have different safety preference indicators (one or more of the five safety indicators) due to different age levels, resulting in heterogeneity of their satisfaction. (3) Resident satisfaction is interactively affected by the satisfaction of surrounding residents due to psychological factors. (4) Family satisfaction, which is the satisfaction of the head of the family, is an important basis for family decisions. Within a certain range, if family satisfaction is high, a family’s willingness to relocate is lower. (5) The dynamic changes in the population density in different geographical locations caused by family relocation, in turn, acts on the environment. The model is based on the above rules to produce a multifactor-affected urban safety livability change system over time.
The ULC-AS operational process is calculated and updated in units of years, as shown in
Figure 6.
First, the environment and agent data are initialized. The environmental data initialization includes the introduction of the coverage of various safety facilities and the building coverage. When the data are updated, the safety facility coverage calculation, population density calculation and building coverage calculation are performed and visualized. The agent data initialization includes basic information on the government, families, residents, and safety facility management agencies as well as the birth rate, mortality rate, employment rate, unemployment rate, initial satisfaction, and vacant resources. When updating the data, the annual growth, new population, number of deaths, educational status, annual income, and satisfaction calculation must be considered. Then, based on the weights of the safety facilities obtained through the survey and the coverage rates of the various safety facilities, the livability calculation is carried out. Next, the residents’ satisfaction is calculated based on their preferences and surrounding facilities coverage, and then the decision-making behavior and psychological calculations of the residents and family agents are carried out. The agent decision-making behaviors include facility construction, family relocation, residents seeking employment, and psychological factors to consider the impact of nearby residents’ satisfaction. Finally, statistics and government policies are established. The statistics include cell, grid, and street data statistics, printing and preservation. Government policies include birth policies, immigrant population growth rates and investment intensity regulations, and then, the cycle is repeated.
4.1.3. Agent
In this model, the four types of agents are government agents, family agents, resident agents, and security facility management agency agents. The government agent represents the highest administrative unit in the study area and can issue the relevant policies for urban planning so that the safety facility management agency can invest in the construction of various facilities. Family agents take the family as a unit, and family members include spouses, parents, children and other relatives living together. The resident agent is an individual, and many resident agents with marriage and blood relationship form a family agent. The safety facility management agency agent represents the unit that collects statistics and manages various safety facilities in the environment.
4.1.4. Agent Attributes and Activities
The attributes of the government agent include the government name, government location and administrative area. The government’s activities are mainly policy adjustments and releases, including the assessment and statistics of the livability of each grid and the satisfaction of all households. The government then issues policies based on statistical results, which are passed on to households, residents, and safety facility management agencies.
The attributes of the family agent include the family ID (unique), the grid number of the family residence, and the family member structure, income, expenses, deposits, satisfaction, and residence preferences (as determined by the head of the family). Family activities include weddings and funerals, raising children, relocation, and family member satisfaction information. These activities are reflected in increases and decreases in family members, changes in education levels, changes in family deposits, changes in family residence and changes in family satisfaction.
The attributes of the resident agent include the resident ID (unique), family ID, age, gender, marital status, educational background (junior high school and below, senior high school and bachelor’s degree), employment status (dependent children, income workers, unemployed people, and retired people), income and residence preferences. Resident agent activities include learning, production, consumption, and satisfaction information. During the period of schooling, the resident agent is a dependent child and needs the family to provide learning fees. Resident agents will have their own income when working and will constantly seek higher wages. A resident will constantly seek jobs that are suitable for them during periods of no work, and a resident will have a pension during their old age that will be part of their family income.
The attributes of the safety facility management agency agent include the grid number of the organization and the types of facilities to be managed (public security facilities, fire protection facilities, transportation facilities, emergency facilities, and residential facilities). The safety facility management organization is the safety facility manager in the urban social system. Its activities are mainly to build, improve or dismantle safety facilities (police stations, hospitals, fire stations, traffic kiosks, police offices, emergency shelters, squares, houses, green spaces, schools, commercial centers, etc.) in the area under its jurisdiction according to policies issued by the government.
4.1.5. Agent Decision Parameters
This model takes safety as an example. The city’s safety livability level and residents’ satisfaction with the urban safety conditions are key parameters. To more clearly describe the calculation of these two key parameters, we refer to safety livability and safety satisfaction. Safety livability includes the cell safety livability, grid safety livability, and street safety livability, whereas safety satisfaction includes the resident safety satisfaction, family safety satisfaction, cell safety satisfaction, grid safety satisfaction, and street safety satisfaction. The specific introduction and formula are as follows:
(1) Safety Livability
The infrastructure distribution data in the model are provided by the urban construction management department of Futian District, Shenzhen. The distribution map of the infrastructure is shown in
Figure 7.
The coverage of each safety indicator is calculated based on the real safety facilities distributed in the geospatial space of Futian District. Centered on the location of a safety facility, the 500-m buffer zone is the scope of the facility, and the real-world security facilities are converted into quantitative coverage data using the geographic information processing software ArcGIS [
29]. The safety indicator coverage is calculated in grids. The specific design rules are shown in Formula (1).
where
is the initial grid security indicator coverage,
is the area of the buffer formed by the facility included in the safety indicator in the grid and
is the total area of the grid.
Through the above calculation method, the coverage of each safety indicator of the 887 grids in Futian District is calculated, and the current safety index distribution map of Futian District is obtained and shown in
Figure 8a–e. The safety facilities considered in the safety indicator distribution map cover 13 medium-sized and above police stations, 10 large-scale fire stations, and many security facilities such as traffic booths, police rooms, emergency shelters, and plazas.
The population density affects the level of resources in an environment and the local facilities. If the population is large, there will be fewer per capita resources. Therefore, the population density is negatively correlated with the evaluation indicators. In this model, safety liability assessment indicators (traffic safety, emergency safety, and residential safety) will change dynamically over time based on the population density. The specific design rules are shown in Formula (2).
where
and
are the populations of the previous year and the current year (including the resident population and the floating population),
is the indicator value for the previous year and
is the number of types of safety facilities.
According to the relationships among the cell, grid and street, three layers of safety livability are defined: cell safety livability,
, grid safety livability,
and street safety livability,
. The cell safety livability is calculated by the weighted average of the coverage ratios of the indicators, the grid safety livability is the average of the cell safety livability of all the cells in a grid, and the street safety livability is the average of the grid safety livability of all the grids on a street. The specific calculations are shown in Formulas (3)–(5).
where
is the weight of
,
is the number of the type of safety facility and 1 ≤
≤ 5,
has a cumulative sum of 1,
is the number of cells and grids and
,
, and
represent the cell, grid, and street numbers, respectively.
(2) Satisfaction
The calculation of the resident agent’s safety satisfaction
is related to two variables. The first variable is the satisfaction degree of the resident agent with the security environment of his location according to his preferences. The second variable is the bias caused by the resident agent’s psychological factors, which are affected by the high or low safety satisfaction of surrounding residents. This paper defines these two variables as not considering the agent interaction satisfaction
and considering the agent interaction satisfaction
.
where
is calculated according to the personal safety preferences and the surrounding environment. The first item is the satisfaction of residents based on their own preferences, and the second item is the change in satisfaction caused by the residents’ influence on the surrounding environment (the average of the preferences of the residents of the eight cells around them). In this paper, the preference of the resident agent in the artificial society is initialized based on the real data obtained by sampling from multiple distributions, thereby ensuring the authenticity of the artificial society.
where
is the weight of the family preference indicators;
is the number of residents’ preference indicators, 0 ≤
≤ 5;
has a cumulative sum of 1;
is an array of preference indicators of the family, the calculation method is shown in Formula (2);
is the number of indicators for family preference, with 0 ≤
≤ 5; and
is the mean of the type
preference for the eight grids in the Moore neighborhood centered on the grid of the family (types are security, fire, traffic, emergency, and residence).
For
, the level of resident satisfaction among the surrounding residents affects the satisfaction of the resident, such that it increases or decreases. The specific performance is as follows: the bottom layer will decrease, the middle level will remain unchanged and the high level will decrease. The specific change probability and range of each case is shown in Formula (8).
Family preferences are generally determined by special groups in the family, such as the elderly and children [
30]. Therefore, these special groups are used as the decision makers of family preferences and defined as the head of the household. If there is no special group in the family, a family member is randomly determined as the head of the household. The family safety satisfaction
, which is determined by the head of household, is the satisfaction of the head of the household. In order to calculate the satisfaction of different geospatial levels, this paper also defines the cell, grid and street safety satisfaction according to a geospatial hierarchy. From the family to the cell, from the cell to the grid, from the grid to the street, the error of the statistical results is minimized through layer by layer calculation. The cell safety satisfaction
is the average family safety satisfaction of all families in the cell. Grid safety satisfaction
is the average of all cell safety satisfaction levels within the grid. Street safety satisfaction
is the average of all grid safety satisfaction levels on the street. The specific formulas are shown as Formulas (9)–(11).
where
is the number of cells and grids and
,
,
, and
represent the family, cell, grid, and street number
, respectively.
4.1.6. Agent Decision and Interaction
The most important feature of the agent in the artificial society is its ability to make decisions independently; that is, it can independently generate corresponding actions according to the environmental conditions without external guidance. In the model, the government agent selects the place that needs the most help for investment construction. The family agent chooses to live in the best place in terms of the living conditions according to its own conditions. The resident agents seek the highest wages that their ability can merit. The security facility management agency agent selects the optimal location to construct, expand and dismantle the facility.
(1) Government agent
At the end of each year, the government agent obtains information on the urban safety livability of each layer, sorts it according to the corresponding level and identifies the grid with the lowest security and satisfaction. Then, the government agent identifies the lowest coverage security indicator in the grid with the lowest security livability and transmits the information to the security facility management agency responsible for the grid. Then, the government agent invests in the construction of safety facilities in the grid.
According to the U-type relationship hypothesis and scale economy theory between China’s urban population density and urbanization process, a positive correlation is observed between China’s urban population and the process of urbanization [
31,
32]. Therefore, changes in the population size are related to the urban economic growth index. In this model, the demographic changes of different regions during the current year will affect the economic situation of the region in the current year, and the economic growth index
is defined to measure this aspect. The specific formula is shown in Formula (12).
where
and
are the populations of the previous year and the current year (including the resident population and the floating population), respectively,
and
create economic benefits for the local population and the changing migrant population of the year, respectively, with
.
The definition of the government investment capacity in this model is positively correlated with the economic growth index. After the model selects the grid, the increase in the value of safety facility coverage is calculated by Formula (13).
where
and
indicate the safety facilities coverage during the current year and previous year, respectively.
(2) Family agent
The family agent determines whether the family is relocated according to the family’s moving desire and combines the family’s economic conditions and vacant resources. The strength of the family’s willingness to move is measured by the family agent’s moving desire. The moving desire (MD) is closely related to the family satisfaction. The more dissatisfied is the family is with the current place of residence, the greater the desire to move. The calculation formula of the MD is shown in Formula (14).
The artificial society constructed in this paper set two adjustable parameters related to home moving during the simulation. One parameter is the minimum threshold for the household moving desire. Only families with a desire to move that is greater than this value will move. The other is the threshold for relocation income. Only families with annual incomes greater than this value have the ability to relocate. Therefore, the family agent moves when the above conditions are met at the same time.
The total number of immigrants is determined by considering the number of immigrants and the immigration ratio, both of which increase each year. The family attribute is assigned according to the family structure and allocated to the immigrant family. If the annual income of the family is greater than or equal to the relocation income threshold under the condition of vacancy, the vacant place that meets the family preference is selected for the relocation by family.
The family agent makes child-bearing decisions every year based on the fertility rate when childbearing conditions are met. Fertility conditions mean that the family includes married women aged 23–40 and married men aged 23–45. In the artificial society constructed in this paper, the fertility rate and sex ratio of newborns are obtained according to the Shenzhen Statistical Yearbook. The fertility policy is set as the two-child policy commonly adopted in China, which means that a family can only have a maximum of two children. At the same time, the family’s ability to have children is also limited by the family’s economic conditions. When the above conditions are met, the family agent implements the decision to have children and updates the family structure.
(3) Resident agent
Resident agents will have preferences for their own needs, which lead to differences in the importance of various facilities. The model reflects these differences by constructing different preferred resident agents and calculating their satisfaction through their preferences. The unemployed residents in the model constantly pay attention to employment information and find jobs every year according to their age and education level. If they find a job, they will allocate the wages according to the job information for the resident agent.
(4) Safety facility agent
In the model, the security facility management agency can adjust the security facilities in the grid under its jurisdiction according to the information transmitted by the government. The specific process is as follows. The safety facility management agency selects the optimal location within the grid and constructs the safety facility in accordance with government policies. Regarding the selection of the location of the safety facility, the following rules apply. Under the condition that the building coverage is between 0.2 and 0.8, the geometric center point of the grid is selected as the optimal construction location. The geometric center-point coordinates (
x,
y) of the grid are calculated as shown in Formulas (15) and (16).
where
and
represent the abscissa and ordinate of the grid and
represents the total number of cells within the grid.
If the cell in which the geometric center point is located does not satisfy the building coverage condition, then a search should be conducted within a cell-centered radius of 100 m, and a cell that satisfies the conditions for the construction location of the safety facility should be randomly selected. If a cell within 100 m cannot satisfy the condition, then the search range should be expanded in increments of 100 m until a cell that satisfies the conditions is found. After the construction location of the safety facility is determined, the safety facility management agency constructs a corresponding type of safety facility at that location, and it will be put into use in the coming year.
4.2. Implementation of the ULC-AS
The ULC-AS was developed by the research team using the Repast (Recursive Porous Agent Simulation Toolkit) simulation modeling tool and written in the Eclipse development platform based on the JAVA language. ArcGIS is used to rasterize real geographic data to provide operational data for the model.
The operational interface of the model is shown in
Figure 9.
In the blue box on the interface is the Repast toolbar, which provides run control functions. In the green box on the left side of the interface is a view bar, which contains all views and data parameter control bars that can be viewed. Above the yellow box is the model running speed regulator, which controls the number of runs and the running time. Below the yellow box is the parameter setting tool that adjusts the environmental variables of the model. The red box in the middle of the interface is a geographical environment view, which can simultaneously observe changes in multiple indicators in real time. Inside the black box on the right side of the interface is a statistical chart that collects the data of the model runtime and displays them in the form of a line chart.
A simulation of more than 1.5 million residents in Futian District was performed with the ULC-AS. For the normal operation of the model, more than 300,000 resident agents were defined, in which one resident agent represents five people in reality. The population change, income/expenditure, average satisfaction, average livability, etc. of the entire region are calculated in annual time units, and the corresponding statistics are output at the end of each year and stored in an Excel spreadsheet. The resident agent, the family agent, the grid and the priority are sequentially reduced, and the priority is included in each cycle. The large amount of data generated during the operation can be updated in real time and stored in the form of a table. The different levels of statistical data, such as safety livability, satisfaction, population density, and building coverage, are represented by normalized values and are divided into ten levels, 0–0.1, 0.1–0.2, …, 0.9–1.0, which are represented by different colors.