sc002.jpgnovelty and the perverse in the urban wild

the introduction of a third unit, the cube. this makes the balancing loop feedback system a collective of 3 separate units. it is still bipolar, because the system only has two states: desired state, and undesired state. only one unit can achieve the desired state at a time.

to the right is a screenshot, an below is its script.










option explicit
'thanks to dave for instruction
Sub dumbNumbers
dim blnYX, intPopulation, intStartXPercentage, i, intNumberPerRow, j, k, arrPopulationMembers()
dim arrPopulationMembersState(), maxCurrentRow, currentMemberState, desiredState
dim numberOfX, maxPercentX, maxNumberOfX, numberOfY, maxPercentY, maxNumberOfY, intStartYPercentage, numberOfZ, maxNumberOfZ, maxPercentZ
dim Y, X, Z
dim arrBoxPts, arrBoxPt0, arrBoxPt1, arrBoxPt2, arrBoxPt3, arrBoxPt4, arrBoxPt5, arrBoxPt6, arrBoxPt7
'setup of population percentages and
'spheres are Y, cones are X, cubes are Z

intPopulation = rhino.getInteger ("input population", 100, 2, 10000)
if isNull(intPopulation) then exit Sub

'for cones(X)
intStartXPercentage = rhino.getInteger ("input percentage of X", 70, 1, 100)
if isNull(intStartXPercentage) then exit Sub
maxPercentX = rhino.getInteger ("input maximum percentage of X", 90, 1, 100)
if isNull(intStartXPercentage) then exit Sub

'for spheres (Y)
intStartYPercentage = rhino.getInteger ("input percentage of Y", (intPopulation - intStartXPercentage) / 3, 1, 100 - intStartXPercentage)
if isNull(intStartYPercentage) then exit Sub
maxPercentY = rhino.getInteger ("input maximum percentage of Y", 90, 1, 100)
if isNull(intStartYPercentage) then exit Sub
'for cubes (Z)
maxPercentZ = rhino.getInteger ("input maximum percentage of Z", 90, 1, 100)
if isNull(maxPercentZ) then exit Sub
i = 0
j = 0
k = 0
intNumberPerRow = int(intPopulation ^ (1/2)) - 1
maxCurrentRow = intNumberPerRow
redim arrPopulationMembers(-1)
redim arrPopulationMembersState(-1)

'build the population
For i = 0 to (intPopulation - 1)
redim preserve arrPopulationMembers(uBound(arrPopulationMembers)+1)
redim preserve arrPopulationMembersState(uBound(arrPopulationMembers)+1)
arrBoxPt0 = array(k*5 + 0.5, j*5 - 0.5, -0.5)
arrBoxPt1 = array(k*5 + 0.5, j*5 + 0.5, -0.5)
arrBoxPt2 = array(k*5 - 0.5, j*5 + 0.5, -0.5)
arrBoxPt3 = array(k*5 - 0.5, j*5 - 0.5, -0.5)
arrBoxPt4 = array(k*5 + 0.5, j*5 - 0.5, 0.5)
arrBoxPt5 = array(k*5 + 0.5, j*5 + 0.5, 0.5)
arrBoxPt6 = array(k*5 - 0.5, j*5 + 0.5, 0.5)
arrBoxPt7 = array(k*5 - 0.5, j*5 - 0.5, 0.5)

'create boxes (Z)
arrBoxPts = array(arrBoxPt0, arrBoxPt1, arrBoxPt2, arrBoxPt3, arrBoxPt4, arrBoxPt5, arrBoxPt6, arrBoxPt7)
arrPopulationMembers(i) = Rhino.AddBox (arrBoxPts)
arrPopulationMembersState(i) = Z
'create cones (X)
If rnd(1)<intStartXPercentage/100 then
rhino.deleteObject(arrPopulationMembers(i))
arrPopulationMembers(i) = Rhino.AddCone (array(k*5,j*5,0), array(k*5,j*5,1), 1)
arrPopulationMembersState(i) = X
End If
'create spheres (Y)
If rnd(1)<intStartXPercentage/100 then
rhino.deleteObject(arrPopulationMembers(i))
arrPopulationMembers(i) = Rhino.AddSphere (array(k*5,j*5,0), 1)
arrPopulationMembersState(i) = Y
End If
if i = maxCurrentRow then
maxCurrentRow = maxCurrentRow + intNumberPerRow
j = j + 1
End If
k = k + 1
if k

intNumberPerRow then k

0
Next
'assess the population to establish desired state
For each currentMemberState in arrPopulationMembersState
if currentMemberState

X then numberOfX

numberOfX + 1
if currentMemberState

Y then numberOfY

numberOfY + 1
if currentMemberState

Z then numberOfZ

numberOfZ + 1
Next
if numberOfX > intPopulation/2 then
desiredState = X
else
desiredState = Y
End if
if numberOfX > maxNumberOfX then desiredState = Y
'fix for max x
if numberOfY > maxNumberOfY then desiredState = X

End Sub
dumbNumbers