CN116128014B - Hydrant layout method, device, electronic equipment and computer readable storage medium - Google Patents

Hydrant layout method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116128014B
CN116128014B CN202310404301.XA CN202310404301A CN116128014B CN 116128014 B CN116128014 B CN 116128014B CN 202310404301 A CN202310404301 A CN 202310404301A CN 116128014 B CN116128014 B CN 116128014B
Authority
CN
China
Prior art keywords
fire
units
grid
preset
fighting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310404301.XA
Other languages
Chinese (zh)
Other versions
CN116128014A (en
Inventor
温桂龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mingyuan Cloud Technology Co Ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202310404301.XA priority Critical patent/CN116128014B/en
Publication of CN116128014A publication Critical patent/CN116128014A/en
Application granted granted Critical
Publication of CN116128014B publication Critical patent/CN116128014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Operations Research (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Game Theory and Decision Science (AREA)
  • Computational Linguistics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Educational Administration (AREA)
  • Primary Health Care (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Remote Sensing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)

Abstract

The application discloses a fire hydrant layout method, a fire hydrant layout device, electronic equipment and a computer readable storage medium, and relates to the technical field of artificial intelligence, wherein the fire hydrant layout method comprises the following steps: dividing a target cell into a plurality of grid cells, and selecting a plurality of preset fire fighting units from the grid cells; screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units; determining an adaptability value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, road conditions, population density and building complexity of all other grid units; and screening a plurality of target fire-fighting units from the fire-fighting units to be selected according to the fitness value corresponding to the fire-fighting units to be selected. The technical problem that blind areas and loopholes easily appear in traditional hydrant layout schemes is solved.

Description

Hydrant layout method, device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a hydrant layout method, apparatus, electronic device, and computer readable storage medium.
Background
With the acceleration of the urban process and the increasing number of people and buildings, the risk of frequent fires in residential communities is increasing, and the fire hydrant is one of the important components of the urban fire protection system, and the position selection and layout of the fire hydrant are self-evident to the importance of the urban fire protection safety. The traditional fire hydrant site selection layout mode is generally based on manual experience and intuition, comprehensive influence of various complex factors is difficult to consider, and limitation is large, so that site selection of the fire hydrant layout position is often scientific and reasonable, fire-fighting blind areas and holes are easy to appear, district fire disaster treatment is not timely caused, and accordingly fire-extinguishing effect is influenced, and casualties and property loss are even caused.
Disclosure of Invention
The main objective of the present application is to provide a fire hydrant layout method, a device, an electronic device and a computer readable storage medium, which aim to solve the technical problems that blind areas and holes easily occur in the traditional fire hydrant layout scheme.
To achieve the above object, the present application provides a hydrant layout method, including:
dividing a target cell into a plurality of grid cells, and selecting a plurality of preset fire fighting units from the grid cells according to map information of the target cell;
screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units;
determining an adaptability value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, road conditions, population density and building complexity of all other grid units;
and screening a preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants.
Optionally, the map information includes building distribution information, and the step of selecting a plurality of preset fire units from the grid units includes:
And selecting each preset fire fighting unit capable of laying out fire hydrants from each grid unit according to the building distribution information.
Optionally, the step of screening the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on the ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units includes:
initializing parameters of an ant colony algorithm to obtain each ant individual with a preset population number;
randomly selecting a preset number of fire-fighting units in a preset population as the current position of each ant individual;
determining a state transition probability of a path of the ant individual from a current position to other grid cells based on a distance between the current position of the ant individual and the other grid cells and a pheromone level on a path of the current position to the other grid cells;
traversing all grid cells through each ant individual based on the state transition probability of each ant individual at the corresponding position;
determining the pheromone level of the preset fire fighting unit in the updated pheromone levels corresponding to the grid units according to the preset pheromone volatilization rate and the pheromone levels released by ant individuals on paths corresponding to the grid units;
Screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units to obtain a plurality of to-be-selected fire-fighting units.
Optionally, the step of determining the state transition probability of the path of the ant individual from the current position to the other grid cell based on the distance between the current position of the ant individual and the other grid cell and the pheromone level on the path of the current position to the other grid cell includes:
calculating a first reciprocal of a path distance of the ant individual between the current position and the first grid cell;
acquiring a first transfer weight of the ant individual from the current position to the first grid unit, wherein the first transfer weight is a product between the first reciprocal and a pheromone level on a path of the current position to the first grid unit;
calculating the reciprocal of the path distance between the current position and other grid units of the ant individual;
obtaining other transfer weights of the ant individuals from the current positions to the other grid cells, wherein the other transfer weights are products of the inverse numbers and pheromone levels on paths of the current positions to the other grid cells;
Summing the transfer weights of the ant individuals transferred from the current position to all grid cells according to the first transfer weight and the other transfer weights to obtain a total weight;
and calculating the ratio of the first transfer weight to the total weight to obtain the state transfer probability of the ant individual to the first grid unit.
Optionally, the step of determining the pheromone level of the preset fire fighting unit in the updated pheromone levels corresponding to the grid units according to the preset pheromone volatilization rate and the pheromone levels released by the ants on the paths corresponding to the grid units comprises the following steps:
determining a pheromone level released by the ant individual on a path from the grid cell to other grid cells according to the selected times of the grid cells and an initial fitness value, wherein the initial fitness value is determined according to the distance between the grid cell and other grid cells, the road condition and the population density and the building complexity of all other grid cells;
and updating the pheromone level on the path of the grid unit according to the preset pheromone volatilization rate and the pheromone level.
Optionally, the step of determining the fitness value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, the road condition, and the population density and the building complexity of all other grid units includes:
when all ant individuals in the ant colony algorithm complete one iteration, acquiring a first weight coefficient corresponding to the road condition between the to-be-selected fire fighting unit and other grid units except the to-be-selected fire fighting unit;
acquiring a second weight coefficient corresponding to population density of the other grid units, and a third weight coefficient corresponding to building complexity of the other grid units;
and determining the fitness value of the to-be-selected fire unit according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient.
Optionally, the step of determining the fitness value of the fire unit to be selected according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient, and the third weight coefficient includes:
Inputting the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient into an fitness function to obtain fitness values respectively corresponding to the fire fighting units to be selected relative to other grid units, wherein the fitness function has the expression:
wherein ,for fitness value, +_>For the distance between the fire unit to be selected and the other grid cells, +.>For the population density of the other grid cells, < +.>Building construction complexity for said other grid cells, < > for>For the road conditions between the fire unit to be selected and the other grid cells +.>Is the first weight coefficient,/->Is the second weight coefficient->Is the third weight coefficient.
The present application also provides a hydrant layout apparatus applied to a hydrant layout device, the hydrant layout apparatus comprising:
the system comprises a unit creation module, a fire control module and a control module, wherein the unit creation module is used for dividing a target cell into a plurality of grid units and selecting a plurality of preset fire control units from the grid units according to map information of the target cell;
the unit screening module is used for screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units;
The fitness calculation module is used for determining a fitness value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, the road condition, the population density and the building complexity of all other grid units;
the layout determining module is used for screening and obtaining preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants.
Optionally, the unit creation module is further configured to:
and selecting each preset fire fighting unit capable of laying out fire hydrants from each grid unit according to the building distribution information.
Optionally, the unit screening module is further configured to:
initializing parameters of an ant colony algorithm to obtain each ant individual with a preset population number;
randomly selecting a preset number of fire-fighting units in a preset population as the current position of each ant individual;
determining a state transition probability of a path of the ant individual from a current position to other grid cells based on a distance between the current position of the ant individual and the other grid cells and a pheromone level on a path of the current position to the other grid cells;
Traversing all grid cells through each ant individual based on the state transition probability of each ant individual at the corresponding position;
determining the pheromone level of the preset fire fighting unit in the updated pheromone levels corresponding to the grid units according to the preset pheromone volatilization rate and the pheromone levels released by ant individuals on paths corresponding to the grid units;
screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units to obtain a plurality of to-be-selected fire-fighting units.
Optionally, the unit screening module is further configured to:
calculating a first reciprocal of a path distance of the ant individual between the current position and the first grid cell;
acquiring a first transfer weight of the ant individual from the current position to the first grid unit, wherein the first transfer weight is a product between the first reciprocal and a pheromone level on a path of the current position to the first grid unit;
calculating the reciprocal of the path distance between the current position and other grid units of the ant individual;
obtaining other transfer weights of the ant individuals from the current positions to the other grid cells, wherein the other transfer weights are products of the inverse numbers and pheromone levels on paths of the current positions to the other grid cells;
Summing the transfer weights of the ant individuals transferred from the current position to all grid cells according to the first transfer weight and the other transfer weights to obtain a total weight;
and calculating the ratio of the first transfer weight to the total weight to obtain the state transfer probability of the ant individual to the first grid unit.
Optionally, the unit screening module is further configured to:
determining a pheromone level released by the ant individual on a path from the grid cell to other grid cells according to the selected times of the grid cells and an initial fitness value, wherein the initial fitness value is determined according to the distance between the grid cell and other grid cells, the road condition and the population density and the building complexity of all other grid cells;
and updating the pheromone level on the path of the grid unit according to the preset pheromone volatilization rate and the pheromone level.
Optionally, the fitness calculating module is further configured to:
when all ant individuals in the ant colony algorithm complete one iteration, acquiring a first weight coefficient corresponding to the road condition between the to-be-selected fire fighting unit and other grid units except the to-be-selected fire fighting unit;
Acquiring a second weight coefficient corresponding to population density of the other grid units, and a third weight coefficient corresponding to building complexity of the other grid units;
and determining the fitness value of the to-be-selected fire unit according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient.
The application also provides an electronic device, which is an entity device, and includes: a memory, a processor, and a program of the hydrant layout method stored on the memory and executable on the processor, which when executed by the processor, implements steps of the hydrant layout method as described above.
The present application also provides a computer readable storage medium having stored thereon a program for implementing a hydrant layout method, which when executed by a processor implements steps of the hydrant layout method as described above.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a hydrant layout method as described above.
The application provides a fire hydrant layout method, device, electronic equipment and computer readable storage medium, firstly dividing a target cell into a plurality of grid units, selecting a plurality of preset fire hydrant units from the grid units according to map information of the target cell, screening the preset fire hydrant units according to the pheromone level of the preset fire hydrant units based on an ant colony algorithm to obtain a plurality of fire hydrant units to be selected, calculating the distance between the fire hydrant units to be selected and all other grid units except the fire hydrant units according to the distance between the fire hydrant units to be selected and the road condition, population densities and building complexities of all other grid units, determining fitness values of the fire hydrant units to be selected, finally screening a preset number of fire hydrant units to be selected from the fire hydrant units to be selected according to the fitness values corresponding to the fire hydrant units to be selected as target fire hydrant units, wherein the preset number is the number of fire hydrant units needing to be laid out, the target fire hydrant is used for the fire hydrant, calculating the information level of the preset fire hydrant units by adopting the group algorithm, calculating the fitness values of the fire hydrant units to be selected from the preset fire hydrant units, calculating the fitness values of the fire hydrant units to be selected from the window conditions, and the fire hydrant units to be selected according to the fitness values corresponding to the fitness values of the fire hydrant units, and the fitness values of the fire hydrant units to be selected by adopting the building complexities, and the fire hydrant is calculated to be more reasonable, and the fire hydrant has the reasonable conditions, the technical problems that blind areas and loopholes are easy to occur in the traditional hydrant layout scheme are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of a first embodiment of a hydrant layout method according to the present application;
FIG. 2 is a grid cell division schematic diagram of a first embodiment of a hydrant layout method according to the present application;
FIG. 3 is a schematic flow chart of steps S231-S236 in the first embodiment of the hydrant layout method according to the present application;
FIG. 4 is a schematic view of the construction of the hydrant layout apparatus of the present application;
fig. 5 is a schematic device structure diagram of a hardware operating environment related to a hydrant layout method according to an embodiment of the present application.
The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present application more comprehensible, the following description will make the technical solutions of the embodiments of the present application clear and complete with reference to the accompanying drawings of the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which are within the scope of the protection of the present application, will be within the purview of one of ordinary skill in the art without the exercise of inventive faculty.
Example 1
With the acceleration of the urban process, the population and the number of buildings are continuously increased, the frequent risk of district fires is also increasing, and the fire hydrant is one of important components of the urban fire protection system, and the selection and layout of the fire hydrant are important to the fire safety of the city. However, the cell layouts are different, and the traditional hydrant site selection layout mode is generally based on experience and intuition, and is difficult to consider the comprehensive influence of various complex factors, so that site selection is not scientific enough, layout is not reasonable enough, blind areas and loopholes are easy to appear, and the fire disaster of the cell is not treated timely, so that the fire extinguishing effect is influenced, and even casualties and property loss are caused. According to the embodiment of the application, through designing a technical scheme utilizing the ant colony algorithm, intelligent site selection and layout are performed on the fire hydrant in the community, so that the coverage range of the fire hydrant is wider, and the use is more convenient.
An embodiment of the present application provides a hydrant layout method, in a first embodiment of the hydrant layout method of the present application, referring to fig. 1, the hydrant layout method includes:
step S10, dividing a target cell into a plurality of grid cells, and selecting a plurality of preset fire fighting units from the grid cells according to map information of the target cell;
step S20, screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units;
step S30, determining the fitness value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, the road condition, the population density and the building complexity of all other grid units;
step S40, screening and obtaining preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants.
In the embodiment of the present application, it should be noted that the target cell may be a newly-built cell, or may be a cell in which the hydrant position needs to be rearranged for upgrading and reconstruction; in the process of screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units, a slightly larger number of to-be-selected fire-fighting units than the preset number can be selected according to specific requirements, and the to-be-selected fire-fighting units can be selected according to the pheromone level, which is not limited; in addition, when the pheromone is released to each preset fire-fighting unit through the ant colony algorithm, the non-passable area and the actual road layout in the target cell are required to be considered by the path of the path, so that the movement transfer of each ant individual among each preset fire-fighting unit in the ant algorithm is realized; the fitness value is the sum of the fitness values of the to-be-selected fire units relative to all other grid units and is used for measuring the degree that each to-be-selected fire unit is suitable for arranging fire hydrants, and the higher the fitness value is, the more suitable the to-be-arranged fire hydrants are.
In addition, when the fitness value of the fire fighting units to be selected is calculated, all other grid units except the fire fighting units to be selected are involved in calculating more than one fire fighting units to be selected, and the other grid units except the fire fighting units to be selected also comprise other fire fighting units to be selected.
As an example, steps S10 to S40 include: modeling a target cell, and dividing the target cell into a plurality of grid units in a regular shape in the established model; determining grid cells unsuitable for arranging fire hydrants according to the map information of the target cell, and selecting other grid cells as preset fire control units, wherein the preset fire control units are grid cells suitable for arranging the fire hydrants; initializing each ant individual based on an ant colony algorithm, and moving among the preset fire-fighting units and releasing pheromones through each ant individual, wherein each ant individual moves according to the actual path among the grid units marked in the map information in the moving process; when each ant individual completes one iteration, screening according to the pheromone level of each preset fire fighting unit to obtain each fire fighting unit to be selected; calculating the fitness value of each fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, the road condition, the population density and the building complexity of all other grid units and the weight coefficients respectively corresponding to the road condition, the population density and the building complexity; and screening a preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants.
Wherein the map information includes building distribution information, and the step of selecting a plurality of preset fire fighting units from the grid units includes:
and S11, selecting each preset fire fighting unit capable of laying out fire hydrants from the grid units according to the building distribution information.
In this embodiment of the present application, it should be noted that the grid units may be square, hexagonal, circular or other regular patterns, referring to fig. 2, where 1 is a common grid unit, 2 is a preset fire-fighting unit, and 3 is an insurmountable grid unit, and fig. 2 is only an example, where the number and distribution of grid units may be divided according to the actual situation of the target cell, which is not limited herein. The preset fire fighting units are grid units in each grid unit, which are suitable for arranging fire hydrants, so that special terrains in certain map information such as artificial lakes, roads, squares and the like are eliminated, or common grid units in which the fire hydrants are not suitable for arrangement according to actual regulations and requirements of a cell are not suitable for arrangement, the positions of the preset fire fighting units should cover the whole cell as much as possible so as to quickly reach any place when a fire disaster occurs, and the map information also comprises areas (such as residential areas, electric vehicle sheds, parking lots, express cabinets, green plants and the like) which can possibly generate the fire disaster, and non-passable barrier areas (such as enclosing walls and artificial lakes) and the like.
As an example, the step of dividing the target cell into a plurality of grid cells and selecting a plurality of preset fire fighting units from the grid cells according to map information of the target cell includes: modeling a target cell in a two-dimensional plane to obtain a cell model corresponding to the target cell, and dividing the cell model into a plurality of square areas with consistent sizes, wherein each square area is a grid unit; generating paths between the grid cells based on the building distribution information in the map information, the paths being used for movement of the ant individuals between the grid cells; and selecting each preset fire fighting unit capable of laying out the fire hydrant from each grid unit according to the building distribution information and other non-layout positions, wherein the non-layout positions are grid unit positions of the non-layout fire hydrant set according to specific conditions of the target cell.
The step of screening among the preset fire units according to the pheromone level of the preset fire units based on the ant colony algorithm to obtain a plurality of to-be-selected fire units comprises the following steps:
step S21, initializing parameters of an ant colony algorithm to obtain a preset population number of ant individuals;
Step S22, randomly selecting a preset population number of preset fire-fighting units as the current positions of the ants;
step S23, determining the state transition probability of the path of the ant individual from the current position to other grid cells based on the distance between the current position of the ant individual and other grid cells and the pheromone level on the path of the current position to other grid cells;
step S24, traversing all grid cells through each ant individual based on the state transition probability of each ant individual at the corresponding position;
step S25, determining the pheromone level of the preset fire fighting unit in the updated pheromone levels corresponding to the grid units according to the preset pheromone volatilization rate and the pheromone levels released by the ants on the paths corresponding to the grid units;
step S26, screening is carried out in the preset fire-fighting units according to the pheromone level of the preset fire-fighting units, and a plurality of to-be-selected fire-fighting units are obtained.
In this embodiment of the present application, it should be noted that the parameters of the ant colony algorithm include a preset population number, a pheromone release coefficient, a state transition probability function and a pheromone update function, where the preset population number is the number of ant individuals, the pheromone release coefficient is used to determine the pheromone level released by the ant individuals in the path, the state transition probability function is used to determine the probability of the ant individuals being transferred to each grid unit, and the pheromone update function is used to determine the pheromone level updated along with the transfer process of the ant individuals on the path between each grid unit. The ant colony algorithm is a probability type algorithm for searching an optimized path in a graph, the inspiration of the probability type algorithm is derived from the behavior of an ant finding the path in the process of searching food, the shortest path from the starting point of a grid unit, passing through other grid units and finally returning to the starting point can be obtained through the ant colony algorithm, the starting point is the grid unit which is used for searching the most suitable for the fire hydrant in the embodiment of the application, the starting point is the preset fire fighting unit corresponding to each ant individual after initialization, the condition is required that the pheromone with different intensity levels is released in the process of the movement of the ant individual, the pheromone level corresponding to each grid unit is the sum of the pheromone levels on each path which is directly communicated with each grid unit, the method is used for representing the number of the ant individual in the previous path of each grid unit, because the ant individual in the ant colony algorithm tends to select a shorter path when performing the movement, all the grid units corresponding to the shorter paths are also the average shorter and faster paths of all the grid units, the elements are suitable for the fire hydrant, and all the grid units are selected from the preset grid units, and all the grid units belong to all the preset grid units, and all the grid units belong to the grid units are selected and are replaced.
As an example, step S21 to step S26 include: acquiring parameters of an ant colony algorithm input by a user, and acquiring a preset population number of each ant individual, wherein the parameters of the ant colony algorithm comprise the preset population number, a pheromone release coefficient, a state transition probability function and a pheromone update function; selecting preset fire-fighting units with the same number as the preset population from the preset fire-fighting units as the current positions of the ant individuals, namely starting points; calculating the state transition probability of the path of the ant individual from the current position to the other grid cells based on the distance between the current position (starting point) of the ant individual and the other grid cells and the pheromone level on the path of the current position to the other grid cells, wherein the distance between the current position (starting point) of the ant individual and the other grid cells is inversely related to the state transition probability, and the pheromone level on the path of the current position to the other grid cells is positively related to the state transition probability; according to the determined state transition probability, enabling each ant individual to traverse all other grid cells, and finally returning to a preset fire-fighting unit (starting point) of departure to complete iteration once, wherein each ant individual can update the state transition probability of going to other grid cells at the current position when reaching a new position, and each ant individual can release pheromone on a path of a path in the process of traversing the grid cells; calculating the updated pheromone level of each grid unit according to the preset pheromone volatilization rate and the pheromone level released by the ant individual on the path corresponding to each grid unit, wherein the preset pheromone volatilization rate and the updated pheromone level are in negative correlation, and the pheromone level released by the ant individual on the path corresponding to each grid unit and the updated pheromone level are in positive correlation; and screening a plurality of fire fighting units to be selected with the pheromone level being in front according to the pheromone level of each preset fire fighting unit, wherein the number of the fire fighting units to be selected is larger than the number of the fire hydrants to be laid out.
In addition, the step of determining the state transition probability of the path of the ant individual from the current position to the other grid cells based on the distance between the current position of the ant individual and the other grid cells and the pheromone level on the path of the current position to the other grid cells includes:
step S231, calculating a first reciprocal of a path distance between the current position and the first grid unit of the ant individual;
step S232, obtaining a first transfer weight value between the ant individual transferred from the current position to the first grid unit, wherein the first transfer weight value is a product between the first reciprocal and a pheromone level on a path of the current position to the first grid unit;
step S233, calculating the reciprocal of the path distance between the current position and other grid units of the ant individual;
step S234, obtaining other transfer weights of the ant individuals from the current positions to the other grid units, wherein the other transfer weights are products of the inverse numbers and pheromone levels on paths of the current positions to the other grid units;
Step S235, summing the transfer weights of the ant individuals transferred from the current position to all grid cells according to the first transfer weight and the other transfer weights to obtain a total weight;
step S236, calculating the ratio of the first transfer weight to the total weight to obtain the state transfer probability of the ant individual going to the first grid unit.
In the embodiment of the present application, it should be noted that, step S231 to step S236 provide a method for calculating a state transition probability of an ant individual going to a first grid unit under a current position by applying a state transition probability function, where, referring to fig. 3, two execution flows of step S231 to step S232 and step S233 to step S234 may be parallel and not in sequence, the first grid unit is one of other grid units, and the method for calculating the state transition probability of an ant individual going to other grid units under a current position may refer to the above method, so as to obtain the state transition probabilities of paths of an ant individual going to all other grid units.
As an example, the expression of the state transition probability function is:
wherein ,i and j are the start point (current position) and the end point (mesh unit to be transferred), respectively, k is the kth ant,for representing the visibility of ant individuals from i to j, the size is the distance between the two +.>Is the inverse of the number of (a),is the pheromone level on the path from i to j at time t,/>A set of grid cells that have not been accessed for the kth ant individual.
In addition, the step of determining the pheromone level of the preset fire fighting unit in the updated pheromone levels corresponding to the grid units according to the preset pheromone volatilization rate and the pheromone levels released by the ants on the paths corresponding to the grid units comprises the following steps:
step S251, determining the pheromone level released by the ant on the paths of the ant individuals from the grid cells to other grid cells according to the selected times of the grid cells and an initial fitness value, wherein the initial fitness value is determined according to the distance between the grid cells and other grid cells, the road condition and the population density and the building complexity of all other grid cells;
step S252, updating the pheromone level on the path of the grid unit according to the preset pheromone volatilization rate and the pheromone level.
In the embodiment of the present application, it should be noted that step S251 provides a method for determining the intensity of pheromone released by an ant, and step S252 provides a method for updating the level of pheromone on a path, where the path of the grid unit includes the levels of pheromone of all paths leading to the grid unit, and each path is represented by a start point and an end point, for example, a start point i and an end point j.
As an example, a pheromone update function corresponding to the pheromone level on the path of the grid unit is updated according to a preset pheromone volatilization rate and the pheromone level as follows:
T(i, j) = (1 - evaporation_rate) * T(i, j) + delta_T(i, j)
wherein T (i, j) is the pheromone level on the path from node i to node j, evapration_rate is the preset pheromone volatilization rate, and delta_T (i, j) is the pheromone level of the ant individual on the path from node i to node j.
As an example, step S251 to step S256 include: acquiring the selected times of the grid cells, the distances between the grid cells and other grid cells, road conditions, population densities and building complexities of all other grid cells; calculating an initial fitness value of the grid unit according to the distance between the grid unit and other grid units, the road condition and the population density and the building complexity of all other grid units, wherein the initial fitness value is obtained by multiplying the population density and the building complexity of the other grid units, the road condition, the population density and the weight coefficients respectively corresponding to the building complexity by the distance between the grid unit and the other grid units except the grid unit, the road condition, the population density and the weight coefficients respectively corresponding to the building complexity, and summing the weight values; calculating the pheromone level released by the ant individual on the paths of the grid cells going to other grid cells according to the selected times of the grid cells, an initial fitness value and a pheromone release coefficient, wherein the selected times of the grid cells are inversely related to the pheromone level released by the ant individual on the paths of the grid cells going to other grid cells, and the initial fitness value is positively related to the pheromone level released by the ant individual on the paths of the grid cells going to other grid cells; inputting the pheromone level into an pheromone updating function to obtain the pheromone level on the updated path.
As an example, the expression corresponding to the step of calculating the pheromone level released by the ant individual from the path of the mesh unit to other mesh units according to the selected times of the mesh unit, the initial fitness value and the pheromone release coefficient may be:
delta_T(i, j) =C*1/E*Fit1
wherein delta_t (i, j) is the released pheromone level of the ant individual on the path from node i to node j, C is the pheromone release coefficient, E is the selected number of times of the grid cell, and Fit1 is the initial fitness value.
In addition, the step of determining the fitness value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, the road condition, and the population density and the building complexity of all other grid units includes:
step S31, when all ant individuals in the ant colony algorithm complete one iteration, acquiring a first weight coefficient corresponding to the road condition between the to-be-selected fire fighting unit and other grid units except the to-be-selected fire fighting unit;
step S32, obtaining a second weight coefficient corresponding to population density of other grid units, and obtaining a third weight coefficient corresponding to building complexity of the other grid units;
And step S33, determining the fitness value of the fire fighting unit to be selected according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient.
In the embodiment of the present application, it should be noted that, after each ant individual completes one iteration, that is, each ant individual traverses all grid cells and returns the grid cells that start initially, where the other grid cells are all grid cells except for the fire fighting unit to be selected in the target cell, the present application lays out many factors that affect the processing speed when processing the fire event when processing the fire fighting unit to be selected by laying out the fire hydrant: the distance, the road condition, the population density of the processing place and the construction complexity are taken into consideration to obtain the adaptability value of the layout fire hydrant of the to-be-selected fire fighting unit, so that the adaptability value can more scientifically and reasonably represent the degree of the to-be-selected fire fighting unit suitable for the layout fire hydrant. The other grid units are a plurality of grid units, the fitness value is also the sum of fitness values corresponding to the to-be-selected fire fighting unit relative to the grid units, and population density is the ratio of population quantity in the other grid units to the area of the grid unit; the building structure complexity is obtained by carrying out weighted average calculation by combining the building height and the building shape, the weight coefficients corresponding to the building height and the building shape respectively can be set according to specific conditions, if the difference of the building heights in a target cell is not large, the weight coefficient of the building height can be set to be low, the difference of the building shapes in the target cell is large, the weight coefficient of the building shape can be set to be high, the building height can be obtained from cell modeling, the building shape can be calculated by fitting the building into a polygon, and the more the edges of the building shape are, the higher the building complexity is; the road condition can be calculated by combining the road width and the traffic flow through weighted average, wherein the weight coefficients of the road width and the traffic flow can be set according to specific conditions, for example, the road width has larger influence, the weight coefficient of the road width can be set to be higher, for example, the traffic flow has larger influence, the weight coefficient of the traffic flow can be set to be higher, the road width can be obtained from cell modeling, the traffic flow can be counted through camera data in a period of time, the wider the road width is, the lower the value of the road condition is, the higher the traffic flow is, the higher the value of the road condition is, and the higher the value of the road condition is, the lower the adaptability value is.
As an example, the step of determining the fitness value of the fire unit to be selected according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient, and the third weight coefficient includes:
inputting the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient into an fitness function to obtain fitness values respectively corresponding to the fire fighting units to be selected relative to other grid units, wherein the fitness function has the expression:
wherein ,for fitness value, +_>For the distance between the fire unit to be selected and the other grid cells, +.>For the population density of the other grid cells, < +.>Building construction complexity for said other grid cells, < > for>For the road conditions between the fire unit to be selected and the other grid cells +.>Is the first weight coefficient,/->Is the second weight coefficient->Is the third weight coefficient.
The embodiment of the application provides a fire hydrant layout method, firstly dividing a target cell into a plurality of grid units, selecting a plurality of preset fire hydrant units from the grid units according to map information of the target cell, screening the preset fire hydrant units according to the pheromone level of the preset fire hydrant units based on an ant colony algorithm to obtain a plurality of fire hydrant units to be selected, determining the fitness value of the fire hydrant units to be selected according to the distance between the fire hydrant units to be selected and all other grid units except the fire hydrant units, the population density and the building complexity of all other grid units, finally screening the fire hydrant units to be selected from the fire hydrant units to be selected according to the fitness value corresponding to the fire hydrant units to be selected to obtain the preset number of fire hydrant units to be selected as target fire hydrant units, wherein the preset number is the number of fire hydrants needing to be laid out, and the target fire hydrant is used for laying out the fire hydrant, the technical problems that blind areas and loopholes are easy to occur in the traditional hydrant layout scheme are solved.
Example two
The embodiment of the application also provides a fire hydrant layout device, the fire hydrant layout device is applied to fire hydrant layout equipment, refer to fig. 4, the fire hydrant layout device includes:
a unit creation module 101, configured to divide a target cell into a plurality of grid units, and select a plurality of preset fire fighting units from the grid units according to map information of the target cell;
the unit screening module 102 is configured to screen the preset fire-fighting units according to the pheromone level of the preset fire-fighting units, so as to obtain a plurality of fire-fighting units to be selected;
the fitness calculating module 103 is configured to determine a fitness value of the fire fighting unit to be selected according to a distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, a road condition, population density and building complexity of all other grid units;
the layout determining module 104 is configured to screen a preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, where the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants.
Optionally, the unit creation module is further configured to:
and selecting each preset fire fighting unit capable of laying out fire hydrants from each grid unit according to the building distribution information.
Optionally, the unit screening module is further configured to:
initializing parameters of an ant colony algorithm to obtain each ant individual with a preset population number;
randomly selecting a preset number of fire-fighting units in a preset population as the current position of each ant individual;
determining a state transition probability of a path of the ant individual from a current position to other grid cells based on a distance between the current position of the ant individual and the other grid cells and a pheromone level on a path of the current position to the other grid cells;
traversing all grid cells through each ant individual based on the state transition probability of each ant individual at the corresponding position;
determining the pheromone level of the preset fire fighting unit in the updated pheromone levels corresponding to the grid units according to the preset pheromone volatilization rate and the pheromone levels released by ant individuals on paths corresponding to the grid units;
screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units to obtain a plurality of to-be-selected fire-fighting units.
Optionally, the unit screening module is further configured to:
calculating a first reciprocal of a path distance of the ant individual between the current position and the first grid cell;
acquiring a first transfer weight of the ant individual from the current position to the first grid unit, wherein the first transfer weight is a product between the first reciprocal and a pheromone level on a path of the current position to the first grid unit;
calculating the reciprocal of the path distance between the current position and other grid units of the ant individual;
obtaining other transfer weights of the ant individuals from the current positions to the other grid cells, wherein the other transfer weights are products of the inverse numbers and pheromone levels on paths of the current positions to the other grid cells;
summing the transfer weights of the ant individuals transferred from the current position to all grid cells according to the first transfer weight and the other transfer weights to obtain a total weight;
and calculating the ratio of the first transfer weight to the total weight to obtain the state transfer probability of the ant individual to the first grid unit.
Optionally, the unit screening module is further configured to:
determining a pheromone level released by the ant individual on a path from the grid cell to other grid cells according to the selected times of the grid cells and an initial fitness value, wherein the initial fitness value is determined according to the distance between the grid cell and other grid cells, the road condition and the population density and the building complexity of all other grid cells;
and updating the pheromone level on the path of the grid unit according to the preset pheromone volatilization rate and the pheromone level.
Optionally, the fitness calculating module is further configured to:
when all ant individuals in the ant colony algorithm complete one iteration, acquiring a first weight coefficient corresponding to the road condition between the to-be-selected fire fighting unit and other grid units except the to-be-selected fire fighting unit;
acquiring a second weight coefficient corresponding to population density of the other grid units, and a third weight coefficient corresponding to building complexity of the other grid units;
and determining the fitness value of the to-be-selected fire unit according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient.
The fire hydrant layout device provided by the application adopts the fire hydrant layout method in the embodiment, so that the technical problems that blind areas and holes are easy to occur in the traditional fire hydrant layout scheme are solved. Compared with the prior art, the beneficial effects of the fire hydrant layout device provided by the embodiment of the application are the same as those of the fire hydrant layout method provided by the embodiment, and other technical features in the fire hydrant layout device are the same as those disclosed by the method of the previous embodiment, so that details are not repeated.
Example III
The embodiment of the application provides electronic equipment, the electronic equipment includes: at least one processor; and a memory communicatively linked to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the hydrant placement method of the first embodiment described above.
Referring now to fig. 5, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistant, personal digital assistants), PADs (tablet computers), PMPs (Portable Media Player, portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage means into a random access memory (RAM, random access memory). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM and RAM are connected to each other via a bus. Input/output (I/O) interfaces are also linked to the bus.
In general, the following systems may be linked to I/O interfaces: input devices including, for example, touch screens, touch pads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid crystal displays (LCDs, liquid crystal display), speakers, vibrators, etc.; storage devices including, for example, magnetic tape, hard disk, etc.; a communication device. The communication means may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by a processing device.
The electronic equipment provided by the application adopts the fire hydrant layout method in the embodiment, and solves the technical problems that blind areas and holes are easy to appear in the traditional fire hydrant layout scheme. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present application are the same as those of the hydrant layout method provided by the first embodiment, and other technical features of the electronic device are the same as those disclosed by the method of the previous embodiment, which is not described herein.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Example IV
The present embodiment provides a computer readable storage medium having computer readable program instructions stored thereon for performing the method of hydrant placement in the first embodiment described above.
The computer readable storage medium provided by the embodiments of the present application may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical link having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (EPROM, erasable Programmable Read-Only Memory, or flash Memory), an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: dividing a target cell into a plurality of grid cells, and selecting a plurality of preset fire fighting units from the grid cells according to map information of the target cell; screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units; determining an adaptability value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, road conditions, population density and building complexity of all other grid units; and screening a preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be linked to the user's computer through any kind of network, including a local area network (LAN, local area network) or a wide area network (WAN, wide Area Network), or it may be linked to an external computer (e.g., through the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The computer readable storage medium is stored with computer readable program instructions for executing the fire hydrant layout method, and solves the technical problem that blind areas and holes are easy to appear in the traditional fire hydrant layout scheme. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the present application are the same as those of the hydrant layout method provided by the above embodiment, and are not described herein.
Example five
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a hydrant layout method as described above.
The computer program product provided by the application solves the technical problem that blind areas and holes are easy to appear in the traditional hydrant layout scheme. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as those of the hydrant layout method provided by the above embodiment, and are not described herein.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims.

Claims (8)

1. A hydrant placement method, comprising:
dividing a target cell into a plurality of grid cells, and selecting a plurality of preset fire fighting units from the grid cells according to map information of the target cell;
screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units;
determining an adaptability value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, road conditions, population density and building complexity of all other grid units;
screening a preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants;
The step of screening among the preset fire units according to the pheromone level of the preset fire units based on the ant colony algorithm to obtain a plurality of to-be-selected fire units comprises the following steps:
initializing parameters of an ant colony algorithm to obtain each ant individual with a preset population number;
randomly selecting a preset number of fire-fighting units in a preset population as the current position of each ant individual;
determining a state transition probability of a path of the ant individual from the current position to the other grid cells based on a distance between the current position of the ant individual and the other grid cells and a pheromone level on a path of the current position to the other grid cells;
traversing all grid cells through each ant individual based on the state transition probability of each ant individual at the corresponding position;
determining a level of pheromone released by the ant individual from the path of the grid cell to other grid cells according to the selected times of the grid cells and an initial fitness value, wherein the initial fitness value is determined according to the distance between the grid cell and other grid cells, the road condition and the population density and the building complexity of all other grid cells, the selected times of the grid cells are inversely related to the level of pheromone released by the ant individual from the path of the grid cell to other grid cells, and the initial fitness value is positively related to the level of pheromone released by the ant individual from the path of the grid cell to other grid cells;
Updating the pheromone level on the path of the grid unit according to the preset pheromone volatilization rate and the pheromone level;
screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units to obtain a plurality of to-be-selected fire-fighting units.
2. The hydrant layout method according to claim 1, wherein the map information includes building distribution information, and the step of selecting a plurality of preset fire units from the grid units includes:
and selecting each preset fire fighting unit capable of laying out fire hydrants from each grid unit according to the building distribution information.
3. The hydrant layout method according to claim 1, wherein the step of determining the state transition probability of the path of the ant individual from the current position to the other grid cell based on the distance between the current position of the ant individual and the other grid cell and the pheromone level on the path of the current position to the other grid cell includes:
calculating a first reciprocal of a path distance of the ant individual between the current position and the first grid cell;
acquiring a first transfer weight of the ant individual from the current position to the first grid unit, wherein the first transfer weight is a product between the first reciprocal and a pheromone level on a path of the current position to the first grid unit;
Calculating the reciprocal of the path distance between the current position and other grid units of the ant individual;
obtaining other transfer weights of the ant individuals from the current positions to the other grid cells, wherein the other transfer weights are products of the inverse numbers and pheromone levels on paths of the current positions to the other grid cells;
summing the transfer weights of the ant individuals transferred from the current position to all grid cells according to the first transfer weight and the other transfer weights to obtain a total weight;
and calculating the ratio of the first transfer weight to the total weight to obtain the state transfer probability of the ant individual to the first grid unit.
4. The hydrant layout method according to claim 1, wherein the step of determining the fitness value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, road conditions, and population density and construction complexity of all other grid units includes:
when all ant individuals in the ant colony algorithm complete one iteration, acquiring a first weight coefficient corresponding to the road condition between the to-be-selected fire fighting unit and other grid units except the to-be-selected fire fighting unit;
Acquiring a second weight coefficient corresponding to population density of the other grid units, and a third weight coefficient corresponding to building complexity of the other grid units;
and determining the fitness value of the to-be-selected fire unit according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient.
5. The hydrant layout method according to claim 4, wherein the step of determining the fitness value of the fire fighting unit to be selected according to the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient, and the third weight coefficient includes:
inputting the distance, the road condition, the population density, the building complexity, the first weight coefficient, the second weight coefficient and the third weight coefficient into an fitness function to obtain fitness values respectively corresponding to the fire fighting units to be selected relative to other grid units, wherein the fitness function has the expression:
wherein ,for fitness value, +_ >For the distance between the fire unit to be selected and the other grid cells, +.>For the population density of the other grid cells, < +.>Building complexity for said other grid cells, < >>For the road conditions between the fire unit to be selected and the other grid cells +.>Is the first weight coefficient,/->Is the second weight coefficient->Is the third weight coefficient.
6. A hydrant layout apparatus, characterized in that the hydrant layout apparatus comprises:
the system comprises a unit creation module, a fire control module and a control module, wherein the unit creation module is used for dividing a target cell into a plurality of grid units and selecting a plurality of preset fire control units from the grid units according to map information of the target cell;
the unit screening module is used for screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units based on an ant colony algorithm to obtain a plurality of to-be-selected fire-fighting units;
the fitness calculation module is used for determining a fitness value of the fire fighting unit to be selected according to the distance between the fire fighting unit to be selected and all other grid units except the fire fighting unit to be selected, the road condition, the population density and the building complexity of all other grid units;
The layout determining module is used for screening a preset number of fire hydrant units to be selected from the fire hydrant units to be selected as target fire hydrant units according to the fitness value corresponding to the fire hydrant units to be selected, wherein the preset number is the number of fire hydrants to be laid out, and the target fire hydrant units are used for laying out the fire hydrants;
wherein, the unit screening module is further for: initializing parameters of an ant colony algorithm to obtain each ant individual with a preset population number; randomly selecting a preset number of fire-fighting units in a preset population as the current position of each ant individual; determining a state transition probability of a path of the ant individual from the current position to the other grid cells based on a distance between the current position of the ant individual and the other grid cells and a pheromone level on a path of the current position to the other grid cells; traversing all grid cells through each ant individual based on the state transition probability of each ant individual at the corresponding position; determining a level of pheromone released by the ant individual from the path of the grid cell to other grid cells according to the selected times of the grid cells and an initial fitness value, wherein the initial fitness value is determined according to the distance between the grid cell and other grid cells, the road condition and the population density and the building complexity of all other grid cells, the selected times of the grid cells are inversely related to the level of pheromone released by the ant individual from the path of the grid cell to other grid cells, and the initial fitness value is positively related to the level of pheromone released by the ant individual from the path of the grid cell to other grid cells; updating the pheromone level on the path of the grid unit according to the preset pheromone volatilization rate and the pheromone level; screening among the preset fire-fighting units according to the pheromone level of the preset fire-fighting units to obtain a plurality of to-be-selected fire-fighting units.
7. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively linked to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the hydrant layout method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a program for realizing a hydrant layout method, which program is executed by a processor to realize the steps of the hydrant layout method according to any one of claims 1 to 5.
CN202310404301.XA 2023-04-17 2023-04-17 Hydrant layout method, device, electronic equipment and computer readable storage medium Active CN116128014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310404301.XA CN116128014B (en) 2023-04-17 2023-04-17 Hydrant layout method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310404301.XA CN116128014B (en) 2023-04-17 2023-04-17 Hydrant layout method, device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN116128014A CN116128014A (en) 2023-05-16
CN116128014B true CN116128014B (en) 2023-08-04

Family

ID=86299473

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310404301.XA Active CN116128014B (en) 2023-04-17 2023-04-17 Hydrant layout method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116128014B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111523698A (en) * 2020-03-20 2020-08-11 全球能源互联网集团有限公司 Ant colony site selection method and device for macroscopically site selection of clean energy base
AU2020103709A4 (en) * 2020-11-26 2021-02-11 Daqing Oilfield Design Institute Co., Ltd A modified particle swarm intelligent optimization method for solving high-dimensional optimization problems of large oil and gas production systems
CN112862203A (en) * 2021-02-22 2021-05-28 中国城市规划设计研究院 Method, device, equipment and storage medium for determining regional fire station layout
CN115079704A (en) * 2022-08-01 2022-09-20 中国电信股份有限公司 Path planning method and device, storage medium and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115150315B (en) * 2022-07-01 2024-04-16 中国银行股份有限公司 ATM (automatic teller machine) site selection method and device based on ant colony algorithm
CN115965171A (en) * 2023-03-10 2023-04-14 吉奥时空信息技术股份有限公司 Micro-park site selection method based on ant colony optimization algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111523698A (en) * 2020-03-20 2020-08-11 全球能源互联网集团有限公司 Ant colony site selection method and device for macroscopically site selection of clean energy base
AU2020103709A4 (en) * 2020-11-26 2021-02-11 Daqing Oilfield Design Institute Co., Ltd A modified particle swarm intelligent optimization method for solving high-dimensional optimization problems of large oil and gas production systems
CN112862203A (en) * 2021-02-22 2021-05-28 中国城市规划设计研究院 Method, device, equipment and storage medium for determining regional fire station layout
CN115079704A (en) * 2022-08-01 2022-09-20 中国电信股份有限公司 Path planning method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN116128014A (en) 2023-05-16

Similar Documents

Publication Publication Date Title
Mustafa et al. Coupling agent-based, cellular automata and logistic regression into a hybrid urban expansion model (HUEM)
Xiong et al. Fire from policy, human interventions, or biophysical factors? Temporal–spatial patterns of forest fire in southwestern China
CN104239636B (en) Fire emergency evacuation simulation method
US20170161614A1 (en) Systems and methods for predicting emergency situations
Kalabokidis et al. AEGIS: a wildfire prevention and management information system
Kalabokidis et al. Virtual Fire: A web-based GIS platform for forest fire control
Emilien et al. Procedural generation of villages on arbitrary terrains
Usman et al. Application of agent-based model simulation for tsunami evacuation in Pacitan, Indonesia
Malek et al. Participatory scenario development to address potential impacts of land use change: an example from the Italian Alps
Koren et al. Proposal for holistic assessment of urban system resilience to natural disasters
CN110910511B (en) Search and rescue flow simulation and interaction system and method based on mixed reality
Fordham et al. Modelling range shifts for invasive vertebrates in response to climate change
Josimović et al. The impact of airport noise as part of a Strategic Environmental Assessment, case study: The Tivat (Montenegro) Airport expansion plan
Liu et al. An agent-based evacuation model for the 2011 Brisbane City-scale riverine flood
CN104200295A (en) Partition based multi-police-intelligent-agent task allocation method in RCRSS (Robo Cup Rescue Simulation System)
CN116128014B (en) Hydrant layout method, device, electronic equipment and computer readable storage medium
JP2019179320A (en) Demographic data creation device and demographic data creation program
KR20210043230A (en) Apparatus and system and method for ifectious disease spread location prediction simulation
CN116739385B (en) Urban traffic evaluation method and device based on spatial superposition analysis
Song et al. A grid-based spatial data model for the simulation and analysis of individual behaviours in micro-spatial environments
Iskandar et al. Agent-based simulation of pedestrians' earthquake evacuation; application to Beirut, Lebanon
CN115238245B (en) Pollutant monitoring method and device, storage medium and electronic equipment
JP6178121B2 (en) Simulated rainfall data generation apparatus, generation method, and program
Qiu et al. A GIS based spatially explicit model of dispersal agent behavior
de Almeida Urban Tourism Crowding Dynamics: Carrying Capacity and Digital Twinning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant