From assela Pathirana
SWMM5-EA a tool for teaching evolutionary algorithms for water professionals
I have been teaching the application of Evolutionary Algorithms (EA) like Genetic Algorithms (GA) since 2006 in two of my courses at UNESCO-IHE (Urban Drainage and Water Asset Management). I think there is a lot of truth in the quotation commonly attributed to Confucius (551–479 BCE): "What I hear I forget, what I see I remember, what I do I understand.". I try to apply this in teaching as much as possible -- let the learners do something and learn.
For many of my needs I found excellent tools on the net: For example, I use orange to teach elementary datamining techniques and use [http://www.ra.cs.uni-tuebingen.de/software/JavaNNS/welcome_e.html JavaNNS) to teach Artificial Neural Networks. But I could not find an acceptable tool to use in my teaching of GA. Once I wrote a console application using C langauge to try to do this. But, modern day students are not often comfortable with working with an application that needs opening a command prompt to use.
Finally I thought of biting the bullet and write one myself. That is SWMM5-EA.
What it does
SWMM5 EA is a simple application to demonstrate how genetic algorithms can be used to solve optimization problems in the field of urban drainage. Typical problems it can solve include:
- Find the optimal pipe/channel sizes for a drainage network to handle a flow of a given magnitude.
- Sizing of SuDS systems for the same purpose.
- Cost-benefit optimization of interventions.
SWMM5 EA is a teaching tool. It has several limitations, by design.
- The drainage model is only 1-D, there's no inundation (2-D) model. (Things need to be kept simple)
- At the moment it is not designed to do whole-life cost optimization.
- At the moment no multi-objective optimization stuff.
How to Use
Figure~1 shows the appearance of SWMM5 EA. The standard workflow is as follows:
- The recommended first step is to create a working drainage network model using EPA-SWMM.
- Create a new project in SWMM5-EA and save it somewhere. ('New Project', then 'Save As')
- Import your swmm network file (say mynetwork.inp) to the project. ('load swmm file')
- Edit your project settings. (Figure 2). Parameters worth mentioning:
- Number of inputs: Set this to the total number of variables you are going to change For example, if you want to size four pipes and 3 reservoirs this number is seven (3+4).
- Number of elites (Number of individuals guaranteed to be selected)-- keep this at 1 or 2.
- Number of evaluations: This is how many individual*generations you want to evaluate. Should be large for any useful results.
- Number of CPUS: SWMM5 EA can do parallel processing. For the first time use 1 for this (serial processing -- good for testing) Use the correct number of processor cores you have once you validate the system to run properly. nCPUs>1 provides less feedback so tracing a problem could be difficult.
- Cost Function 1: Assuming your variables are v1..Vn (n=Number of Inputs ) write a formula that calculates the cost (e.g. cost of laying pipes or certain diameter, cost of constructing drainage area).
- Cost Function 2: Assuming