One wastewater treatment simulation software line drawing optimization method
Technical field
The present invention relates to a kind of wastewater treatment analogue technique field, especially relate to that a kind of intersection-type collision is few, the interface simulation software of wastewater treatment clearly line drawing optimization method.
Background technology
In the process of disposing of sewage in city, because the influent quality of Sewage Plant is different, even differ huge, the load of water inlet is dynamic change in time also, the scale of Sewage Plant, design parameter, the running status reason such as also vary.Many Sewage Plant operational effects are not good, effluent quality is difficult to up to standardly, and therefore Sewage Plant has pair wastewater treatment to carry out the tight demand of technological transformation.And for reforming technology, need to further investigate influent quality, process control, effluent quality three's oneself relation, and by improving technique, adjusting and control parameter, thereby improve water quality, reduce aeration energy consumption.
Sewage treatment process relates to multiple processes, and technique is very complicated.Adjusting process is long with the cycle of need, and has certain risk.The operational process of therefore simulating Sewage Plant by the mode of software, has important realistic meaning.
In various Sewage Plant simulation softwards, BioWin simulation softward was developed by Jia Na Envirosim affiliated company the nineties in 20th century.Be widely used on North America and Australia and other places.The line of this software adopts once the simple method connecting.Basic strategy is exactly to solve two shortest paths between tie point, and algorithm is very simple, increases a turning point between two tie points.The realization of this method is very simple, but the impact of analogue unit and existing line around when this method is not considered to solve line path, therefore in the time that functional block is many, between line and line, there is more intersect or overlapping, line is also many to passing through of analogue unit around, between line and line, can overlap, cause and cannot judge clearly the contact between analogue unit.Although BioWin supports manual adjustments line, has 3 shortcomings: 1. the adjustable degree of line is not high.Substantially line only has one section of permission level wherein or the adjusting of reaching the standard grade.2. more when aeration analogue unit, line is compared with under complicated situation, and the workload of manual adjustments is larger, the efficiency of impact configuration.3. because this software line generally only has a turning point, a line can be divided into 3 sections of broken lines.Therefore allow manually to adjust line section and only have wherein one section, have certain limitation.When line is very under complicated situation, the manual adjustments that this software provides is also helpless.
Summary of the invention
The present invention solves to simulate line easy problem of intersection-type collision under complex situations in prior art, provides that a kind of intersection-type collision is few, the interface simulation software of wastewater treatment clearly line drawing optimization method.
The present invention has also solved in prior art and has simulated the difficult restricted problem of line adjustment, and the dynamically wastewater treatment simulation software line drawing optimization method of adjustment of a kind of convenience is provided.
Above-mentioned technical matters of the present invention is mainly solved by following technical proposals: a kind of wastewater treatment simulation software line drawing optimization method, for the line between functional module, comprises the following steps:
Step 1, after definite starting point and point of destination, line is set out and is advanced along X-direction by starting point, if do not collide with functional module, until arrive while being positioned at the point on same vertical line with point of destination, setting this point is turning point, and is set out and advanced to point of destination along Y direction by this turning point;
If line runs into functional module in the process of advancing, line adopts XY axle dynamic hedging strategy to process, explore an original route towards a direction, and original route factor is carried out to record, calculate priority factor, XY axle dynamic hedging strategy comprises X-axis evasion tactics and Y-axis evasion tactics
X-axis evasion tactics: in the time that X-direction is advanced, if the collision of generation and functional module generates turning point and then advances to Y direction;
Y-axis evasion tactics: advance along Y direction, until line exceedes functional module upper end or lower end, generate turning point and then advance along X-direction;
Step 2, carry out path and recall arbitration calculating, then this original route is recalled to search, the route of exploring other according to XY axle dynamic hedging strategy, records the factor of these routes, and calculates priority factor, simultaneously by comparing, find out the route of minimum priority factor, determine that this route is optimization route, and draw on software interface.First the present invention explores a route by XY axle dynamic hedging strategy towards a direction, and the priority factor of this route is carried out to record, then obtain other routes by recalling search, carry out priority factor comparison by recalling the route that obtains of search with the route of record simultaneously, the route that constantly route of record is replaced with to priority factor minimum, finally obtains optimized route.The present invention compares existing software line and makes line and line between functional module reduce juxtaposition as far as possible, between line and functional module, reduces and passes through collision as far as possible, makes graphic interface more clear.
As a kind of preferred version, described in recall search process be:
A. date back to a upper turning point by the point of destination of initial line,
B. judge whether this turning point is positioned on same vertical line with point of destination, if continue to recall the previous turning point of current turning point, enters step C, enters if not step C;
C. judge whether this turning point is starting point, if search finishes, enter if not step D;
Whether D. judge by line after this turning point and in Y-axis, advance, continue if not to recall the previous turning point of current turning point, repeating step C, if enter step e;
E. towards advancing by the contrary direction of line working direction after current turning point, according to XY axle dynamic hedging strategy, explore a route towards a direction;
If F. all exploration is complete for current turning point Y-axis above-below direction, continue to date back to a turning point, enter step C.By recalling search, explore other paths, for priority factor comparison, to find out optimal route.
As a kind of preferred version, in X-axis evasion tactics, in the time bumping situation with functional module, set constant a, line is set turning point in range capability module a distance, then advances along Y direction; In Y-axis evasion tactics, set constant a, line exceedes functional module upper end or lower end a distance is set turning point, then advances along X-direction; Described constant a is predefined distance value.Set constant a, numerical value is adjusted as required.This constant a is the distance that the functional module on line and path keeps.
As a kind of preferred version, the factor of described line comprises the length J of line, turning point quantity K, and the algorithm of priority factor is S=J*m+ (K+1) * n, wherein m, n are the decimal between pre-set 0 to 1.M, n, by determining after test of many times, are the numerical value setting in formula.This priority factor shows that m is relatively larger, and the impact of wire length is larger, and line tends to the shorter route of distance, otherwise n is larger, and the impact of turning point is larger, and line tends to the less route of turning point.
As a kind of preferred version, method also comprises dynamic and intelligent adjustment strategy, and this dynamic and intelligent adjustment strategy is:
When a functional module tie point carries out line as output in elected, take this tie point as starting point, move the current point in place as point of destination take mouse, obtain optimization path by step 1 to step 2, and draw on software interface; After mouse position changes, repeating step one, to step 2, recalculates optimization path, and again on software interface, draws;
When in elected, the tie point of a functional module carries out line as output, mouse is clicked in disconnected some region, mouse click place increases a turning point, take this turning point as point of destination, arrive step 2 by step 1, between the tie point as output and turning point, obtain optimization path and draw, if mouse continues to increase multiple turning points, take previous turning point as starting point, a rear turning point is point of destination, between two turning points, obtain optimization path and draw, until mouse is finally clicked functional module tie point as input, in the end turning point and as obtaining optimization path and draw by step 1 and step 2 between the tie point of input.Realized the automatic adjustment of line between functional module by step 1 and step 2, simplify operating personnel's workload, but still Shortcomings, when functional module complex distribution, line is more, the line now obtaining by step 1 and step 2 is still likely comparatively complicated, need to be optimized by dynamic and intelligent adjustment strategy.In the present invention, being simply to carry out automatic connecting by step 1 and two, effectively improve user's allocative efficiency, in the time that configuration is complicated, can carries out dynamic and intelligent strategy and adjust, both increased dirigibility, improved again the clear and reading property of line.
Therefore, advantage of the present invention is: 1. reduced line between functional module and the juxtaposition of line, the collision between line and functional module, makes graphic interface more clear.2. can realize dynamic and intelligent and adjust strategy, effectively improve user's allocative efficiency, increase dirigibility, improve again the clear and reading property of line.
Accompanying drawing explanation
Accompanying drawing 1 is a kind of schematic flow sheet of the present invention;
Accompanying drawing 2 is a kind of schematic flow sheets of recalling search in the present invention;
Accompanying drawing 3 is a kind of schematic diagram that in example of the present invention, line connects;
The another kind of schematic diagram that on accompanying drawing 4, in example of the present invention, line connects.
Embodiment
Below by embodiment, and by reference to the accompanying drawings, technical scheme of the present invention is described in further detail.
Embodiment:
A kind of wastewater treatment of the present embodiment simulation software line drawing optimization method, for the line between analog functional module, sets constant a, the numerical value of Coefficient m, n.As shown in Figure 1, determine that a functional module output connection is as starting point, another functional module incoming junction is as point of destination, and what between starting point and point of destination, route was formulated comprises the following steps:
Step 1, is set out and is advanced along X-direction by starting point; Judged whether to bump with functional module, if not, advanced until arrive with point of destination while being positioned at the point on same vertical line always, setting this point is turning point, and is set out and advanced to point of destination along Y direction by this turning point; If so, process according to XY axle dynamic hedging strategy.
Step 2, according to X-axis evasion tactics, sets turning point in range capability module a distance, then advances along Y-axis one extreme direction.
Step 3, then according to Y-axis evasion tactics, exceeding functional module upper end or lower end a distance setting turning point, then advance along X-direction.
Step 4, if continue to run into functional module in X-direction is advanced process, repeat according to XY axle dynamic hedging strategy, until arrive while being positioned at the point on same vertical line with point of destination, setting this point is turning point, and is set out and advanced to point of destination along Y direction by this turning point.
Step 5, explores to an original route, records length J and the turning point quantity K of original route, and calculates priority factor S (0)=J*m+ (K+1) * n of original route.
Step 6, recalls search to the original route obtaining, and as shown in Figure 2, starts to date back to a upper turning point by point of destination.
Step 7, judges whether current turning point is positioned on same vertical line with point of destination, is the previous turning point that continues to date back to current turnover, then enters step 8; Enter if not step 9.
Step 8, judges whether this turning point is starting point, if search finishes, enters if not step 9.
Whether step 9, judge through line after this turning point and advance along Y direction, if not, dates back to a upper turning point of current turning point, gets back to step 8; If so, towards advancing by the contrary direction of line working direction after current turning point, the operation of execution step 1 to 4, explores a route.
Step 10, record length J and the turning point quantity K of this route, and calculate the priority factor S (1) of original route, according to priority arbitration strategy, S (0) and S (1) are compared, if S (0) is less than S (1), the current exploration in surface route out does not reach requirement, if S (0) is greater than S (1), replace priority factor and be recorded as S (1), be that the route of S (1) is replaced original route by priority factor simultaneously.
Step 11, if all search is complete for current place turning point Y-axis above-below direction, continues to date back to a turning point, the operation of repeating step 8 to 10.
Step 12, until date back to starting point, recalls search and finishes, and obtains the route of priority factor minimum, determines that this route is optimization route, and draws on software interface.
In order can dynamically to adjust line more flexibly under complex situations, the present invention has also formulated dynamic and intelligent and has adjusted strategy, comprising in addition:
When a functional module tie point carries out line as output in elected, take this tie point as starting point, move the current point in place as point of destination take mouse, obtain optimization path by step 1 above to step 12, and draw on software interface; After mouse position changes, repeating step 1, to step 12, recalculates optimization path, and again on software interface, draws;
When in elected, the tie point of a functional module carries out line as output, mouse is clicked in disconnected some region, mouse click place increases a turning point, take this turning point as point of destination, arrive step 12 by step 1, between the tie point as output and turning point, obtain optimization path and draw, if mouse continues to increase multiple turning points, take previous turning point as starting point, a rear turning point is point of destination, between two turning points, obtain optimization path and draw, until mouse is finally clicked functional module tie point as input, in the end turning point and as obtaining optimization path and draw by step 1 and step 12 between the tie point of input.
Describe with object lesson below, as shown in Figure 3, suppose to have 5 functional modules, when wanting linkage function module 1 output connection to the line between functional module 5 incoming junctions, according to XY axle dynamic hedging strategy, line collides functional module 2 in X-axis is advanced process, the front a of functional module 2 apart from set turning point, then upwards advance along Y direction, after arrival functional module 2 top a distances, reset a turning point, then continue to advance along X-direction.In the process of advancing, run into again functional module 4, continue to operate according to XY axle dynamic hedging strategy, set turning point then along upwards advancing along Y direction, arrive functional module 4 top a apart from setting turning point, then advance along X-direction, arrive a point, this point and functional module 5 incoming junctions are positioned on same vertical line, set turning point by this point, be connected with functional module 5 incoming junctions downwards, obtain like this original route.Record original route length and turnover and count, calculate priority factor S (0).
Recall search, as shown in 2, first date back to turning point a, this turning point a is for to be positioned on same vertical line with point of destination, continue to date back to a turning point b, after turning point b, line is not in Y direction, is continuing to date back to a turning point c, and turning point c satisfies condition, select to advance along Y direction down with the direction that line is contrary before, then according to XY axle dynamic hedging strategy, as shown in Figure 4, explore a route, be designated as route 1, record road, 1 length and turnover are counted, and calculate route 1 priority factor S (1).S (1) is compared with S (0), and S (1) is less, uses S (1) to replace S (0), replaces original route with route 1.Turning point c explores complete, continues to date back to last turning point d, repeats step above, until date back to starting point, recalls search and finishes.Finally obtain the route of priority factor minimum, as the route in Fig. 4, setting this route is optimization route, finally on software interface, draws.
Specific embodiment described herein is only to the explanation for example of the present invention's spirit.Those skilled in the art can make various modifications or supplement or adopt similar mode to substitute described specific embodiment, but can't depart from spirit of the present invention or surmount the defined scope of appended claims.
Although more used the terms such as functional module, turning point, starting point, point of destination herein, do not got rid of the possibility that uses other term.Use these terms to be only used to describe more easily and explain essence of the present invention; They are construed to any additional restriction is all contrary with spirit of the present invention.