<%@ Language=VBScript %><% option explicit %> Rainer's research on evolution, skills, and language comprehension <% DIM ScreenWidth, ScreenHeight DIM timeout DIM gen_parent, gen_child DIM x1, x2 'horizontal DIM y1, y2 'vertical DIM msg '-- for errors DIM CS_1 'Connection String DIM RS_0, Q_0, SID 'RecordSet, Query - for sessionID DIM RS_1, RS_2, RS_3, RS_4, RS_5 'RecordSet DIM Q_1, Q_2, Q_3, Q_4, Q_5 'SQL query against the db DIM RWline1, RWline2, RWline3 DIM action DIM choice_1 DIM nCount, count1, max_a, max_b, min_a, min_b, diff_a, diff_b DIM popCount, popCountLimit DIM att_a, att_b '' extend the timeout to allow for long files timeout = Server.ScriptTimeout '' Response.Write "Initial timeout=" & timeout & "
" Server.ScriptTimeout = 1200 ScreenWidth = Request.Cookies("Humble")("ScreenWidth") ScreenHeight = Request.Cookies("Humble")("ScreenHeight") CS_1 = "DSN=evolve" gen_parent = 1 gen_child = 2 IF Request.QueryString("Submitted") = "true" THEN choice_1 = Trim(Request.Form("Choice_1")) popCount = Trim(Request.Form("PopCount")) popCountLimit = Trim(Request.Form("PopCountLimit")) Response.Cookies("Humble")("urPopCount")=popCount Response.Cookies("Humble")("PopCountLimit")=popCountLimit IF NOT Len(choice_1) > 0 THEN choice_1 = -1 END IF IF choice_1 > 0 THEN max_a = Trim(Request.Form("max_A")) * 10 'for discretizing values max_b = Trim(Request.Form("max_B")) * 5 min_a = Trim(Request.Form("min_A")) * 10 min_b = Trim(Request.Form("min_B")) * 5 ELSE max_a = 100 * 10 max_b = 100 * 5 min_a = 0 min_b = 0 END IF Response.Cookies("Humble")("max_A")=max_a Response.Cookies("Humble")("max_B")=max_b Response.Cookies("Humble")("min_A")=min_a Response.Cookies("Humble")("min_B")=min_b diff_a = max_a - min_a diff_b = max_b - min_b Response.Cookies("Humble")("InitDist")=min_a + diff_a/2 Response.Cookies("Humble")("Dist")=min_b + diff_b/2 ' RS_1.MoveLast '-- ur-population table with attribute data Q_0 = "SELECT * FROM gen_0" ' Response.Write Q_0 & "
" SET RS_0 = Server.CreateObject("ADODB.Recordset") RS_0.Open Q_0, CS_1, adOpenKeySet, adLockPessimistic, adCmdText IF RS_0.EOF THEN msg = " *** no data gen_1 *** " ELSE nCount = RS_0.RecordCount RS_0.MoveFirst END IF ' ---- need to copy to the initial parent and child generations ---- '-- set up parent=gen_1 table with attribute data Q_1 = "SELECT * FROM gen_" & gen_parent SET RS_1 = Server.CreateObject("ADODB.Recordset") RS_1.Open Q_1, CS_1, adOpenKeySet, adLockPessimistic, adCmdText IF NOT RS_1.EOF THEN RS_1.MoveFirst END IF '-- set up child=gen_2 table with attribute data Q_2 = "SELECT * FROM gen_2" SET RS_2 = Server.CreateObject("ADODB.Recordset") RS_2.Open Q_2, CS_1, adOpenKeySet, adLockPessimistic, adCmdText IF NOT RS_2.EOF THEN RS_2.MoveFirst END IF ' start random number generator RANDOMIZE FOR count1 = 1 TO popCount IF RS_0.EOF THEN RS_0.AddNew END IF IF RS_1.EOF THEN RS_1.AddNew END IF IF RS_2.EOF THEN RS_2.AddNew END IF att_a = min_a + ROUND( RND * diff_a) RS_0.Fields("A") = att_a RS_1.Fields("A") = att_a RS_2.Fields("A") = att_a att_b = (min_b + ROUND( RND * diff_b)) * 2 RS_0.Fields("B") = att_b RS_1.Fields("B") = att_b RS_2.Fields("B") = att_b RS_0.Update RS_1.Update RS_2.Update RS_0.MoveNext RS_1.MoveNext RS_2.MoveNext NEXT Response.Redirect "toc_top.htm" ' msg = " *** " & min_a & "," & diff_a & "," & min_b & "," & diff_b & " ***" END IF '---*** Request.QueryString("Submitted") ***------------------------ action = "init_Pop.asp?submitted=true" %>


The populations are characterized with two attributes, A and B, using numeric scales, ranging from 0 to 100, with precision 0.1

<% popCount=100 popCountLimit=2000 choice_1=-1 %>
> <% IF Len(msg) > 0 THEN %> <% END IF %> <% Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" %>
Please characterize the start-up population
<%=msg%>
initial Population size: <% Response.Write "" %>
Population limit: <% Response.Write "" %>
2D attribute space: flat distribution (equiprobable) between limits
Min value for AMax value for A Min value for BMax value for B
Min A=0Max A=100Min B=0Max B=100

Values are discretized at 0.1 intervals for attribute A and for attribute B.

Future attribute spaces: circular population distributions (and other shapes); multiple shapes with overlap (bifurcation, gender)
also: Gaussian and other shaped distributions <% '' reset the timeout Server.ScriptTimeout = timeout Response.End '-----------------------------------------------------------%>