'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'Name: CELLGIS.Master ' ' ' 'Description: - Gets a list of variables from CELLGIS.Control Script ' ' - Sets up tower coverage (adds of tower capacities for ' ' towers with multiple antannae) ' ' - Sets up population coverage (calculates traffic flow ' ' for different scenarios, calculates cell phone usage) ' ' - Creates Tower Access Areas ' ' - Unions with Population, Assigns users to towers ' ' - Removes saturated towers from tower coverage ' ' - Begins iteration again (creates new tower access areas,' ' new union, etc) ' ' ' 'Input: List of variables (directories, population variables, overrides' ' to adjust ranges and capacities, coverages used, query string ' ' containing which towers to use [ie only fido, only analog, ' ' etc.]) ' ' ' 'Output: polygon coverage showing areas where people remain without ' ' having access to a cell tower. ' ' ' 'Written By: Allan Glen and Jeff Nash ' 'Date: Spring 2000 ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' theView = Av.GetActiveDoc '*** Gets Variables from CELLGIS.Control_Script _workingdir = Self.Get(0) 'd:\temp\ _outdir = _workingdir + Self.Get(1) 'd:\temp\try1\ _tempdir = _outdir + Self.Get(2) 'd:\temp\try1\temp\ statsfile = Self.Get(3) time = Self.Get(4) People_car = Self.Get(5).AsNumber rushhour = Self.Get(6).AsNumber ph_owners = Self.Get(7).AsNumber ph_users = Self.Get(8).AsNumber ana_ovrd = Self.Get(9).AsNumber pcs_ovrd = Self.Get(10).AsNumber cap_ovrd = Self.Get(11).AsNumber twrthm = theView.FindTheme(Self.Get(12)) centhm = theView.FindTheme(Self.Get(13)) MMIthm = theView.FindTheme(Self.Get(14)) trafthm =theView.FindTheme(Self.Get(15)) twrquery = Self.Get(16) twrquery = "[type] = ""analog""" ' **** STAGE 1 - Tower Locations twrfilestr = "newtower.shp" twrthm = av.Run("CELLGIS.inTowerThemeProcess",{twrthm, twrfilestr, twrquery, ana_ovrd, pcs_ovrd, cap_ovrd}) ' *** STAGE 2 - Incorporating Disaster Scenarios 'not yet automated ' **** STAGE 3 - Diurnal Migration Patterns cenfilestr = _tempdir + "newpop.shp" cenThm = av.Run("CELLGIS.CopyShape", {centhm.GetFtab, cenfilestr}) ' If NIGHT, no migration happens. if (time = "DAY") then ' If day, move people. centhm = av.Run("CELLGIS.TrafficFlow",{centhm,trafthm, people_car, rushhour, time}) end ' **** STAGE 4 - Modeling Levels Of Cell Phone Usage centhm = av.Run("CELLGIS.CellphoneUsers",{centhm, ph_owners, ph_users}) ' **** ITERATION LOOP - This process continues removing saturated towers until ' a coverage remains of people without cell phone service ' where all towers with remaining capacity are not in ' range to offer service. twrthmFtab = twrthm.GetFtab twrthmbitmap = twrthmFtab.GetSelection twrthmbitmap.SetAll standingtowers = twrthmbitmap.count _itrnum = 1 numremoved = 1 'no tower actually removed yet. ' **** BEGIN WHILE LOOP ' loop ends when all towers are removed, or no towers are removed. while ((numremoved > 0) AND (numremoved <> standingtowers)) twrthmbitmap = twrthmFtab.GetSelection twrthmbitmap.clearall standingtowers = twrthmbitmap.count ' **** STAGE 5 - Visualizing Tower Access twrareathm = av.run("CELLGIS.CreateTowerAccessAreas",{twrthm}) twrareathmFtab = twrareathm.GetFtab twrareathmbitmap = twrareathmFtab.GetSelection twrareathmbitmap.SetAll standingtowers = twrareathmbitmap.count ' **** STAGE 6 - Determining Cellular Service Supply and Demand unionthm = av.Run("CELLGIS.TowerCensusUnion",{twrareathm,centhm}) unionthmFtab = unionthm.GetFtab unionthmbitmap = unionthmFtab.GetSelection unionthmbitmap.SetAll ' **** STAGE 7 - Determining Saturated Towers and Remaining Demand returnlist = av.Run("CELLGIS.AssignToTowers",{unionthm, twrthm}) numremoved = returnlist.Get(0) centhm = returnlist.Get(1) twrthm = returnlist.Get(2) twrthm.GetFtab.GetSelection.ClearAll centhm.GetFtab.GetSelection.ClearAll msgbox.Report("The number of towers removed is " + numremoved.AsString + NL + "There was " + standingtowers.AsString + NL + "The number of remaining towers is" + (standingtowers - numremoved).AsString + NL + "The while loop will evaluate to " + (((numremoved > 0) AND (numremoved <> standingtowers))).AsString, "Iteration Info") continueop = msgbox.YesNo("Do you want to continue","End of " + _itrnum.AsString + " iteration...",true) if (continueop = false) then exit end _itrnum = _itrnum + 1 'keeps track of iterations end 'end while msgbox.info("FINISHED!","Locations Without Service have been Calculated.")