osmosis_chamber

No description for this project.



Agents

Number of agents: 6

Behaviors


BackgroundBackground

Number of methods: 1


WHILE-RUNNING ()

Put text here to explain what this method does!

Number of rules: 1 

If
no condition
Then
no action



CounterCounter

Number of methods: 2


WHILE-RUNNING ()

Zero counters and broadcast the count message.

Number of rules: 1 

If
no condition
Then
SET (@Total_Conc , to , (@Glucose_left_count+@Glucose_right_count)/(@Volume_left_count+@Volume_right_count)), and
SET (@Left_Conc , to , @Glucose_left_count/@Volume_left_count), and
SET (@Right_Conc , to , @Glucose_right_count/@Volume_right_count), and
MAKE ((0 0) , adjust_levels), and
SET (@Row_sweep , to , @Row_sweep-1), and
SET (@Glucose_left_count , to , 0), and
SET (@Glucose_right_count , to , 0), and
SET (@Water_right_count , to , 0), and
SET (@Water_left_count , to , 0), and
SET (@Volume_left_count , to , 0), and
SET (@Volume_right_count , to , 0), and
BROADCAST (Glucose_Left , count), and
BROADCAST (Water_Left , count), and
BROADCAST (Water_Volume , tally)

ON (adjust_levels)

Determine wheteher to add or remove a row on the left side of the membrane

Number of rules: 4 

If
IS (@Left_Conc-@Total_Conc , < , -0.004), and
IS (@Right_Conc-@Total_Conc , > , 0.004), and
IS (@Lright_corner , = , 0), and
IS (@Rright_corner , = , 0), and
IS (@Volume_right_count , < , 2335)
Then
SET (@left_rows , to , -1), and
SET (@right_rows , to , 1), and
SET (@Lright_corner , to , 1), and
SET (@Rright_corner , to , 1), and
SET (@Lleft_corner , to , 1), and
SET (@Rleft_corner , to , 1), and
SET (@Row_sweep , to , 34)

If
IS (@Left_Conc-@Total_Conc , > , 0.004), and
IS (@Right_Conc-@Total_Conc , < , -0.004), and
IS (@Lright_corner , = , 0), and
IS (@Rright_corner , = , 0), and
IS (@Volume_left_count , < , 2335)
Then
SET (@left_rows , to , 1), and
SET (@right_rows , to , -1), and
SET (@Lright_corner , to , 1), and
SET (@Rright_corner , to , 1), and
SET (@Lleft_corner , to , 1), and
SET (@Rleft_corner , to , 1), and
SET (@Row_sweep , to , 34)

If
IS (@Left_Conc-@Total_Conc , < , 0.004), and
IS (@Left_Conc-@Total_Conc , > , -0.004), and
IS (@Right_Conc-@Total_Conc , < , 0.004), and
IS (@Right_Conc-@Total_Conc , > , -0.004)
Then
SET (@left_rows , to , 0), and
SET (@right_rows , to , 0)

If
IS (@Row_sweep , <= , 0)
Then
SET (@Lright_corner , to , 0), and
SET (@Rright_corner , to , 0), and
SET (@Lleft_corner , to , 0), and
SET (@Rleft_corner , to , 0)



Glucose_LeftGlucose_Left

Number of methods: 2


WHILE-RUNNING ()

Glucose particles diffuse.

Number of rules: 8 

If
SEE ((0 0) , glucose_left), and
SEE ((-1 0) , air), and
IS (@left_rows , = , -1)
Then
MOVE ((1 0))

If
SEE ((0 0) , glucose_right), and
SEE ((-1 0) , air), and
IS (@right_rows , = , -1)
Then
MOVE ((1 0))

If
SEE ((0 0) , glucose_left), and
SEE ((0 1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , glucose_right), and
SEE ((0 1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , glucose_left), and
SEE ((0 -1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , glucose_right), and
SEE ((0 -1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , glucose_left)
Then
MOVE-RANDOM-ON (water_volume)

If
SEE ((0 0) , glucose_right)
Then
MOVE-RANDOM-ON (volume_right)

ON (count)

Glucose particles add themselves to the counts on either side of the membrane.

Number of rules: 2 

If
SEE ((0 0) , glucose_left)
Then
SET (@Glucose_left_count , to , @Glucose_left_count + 1)

If
SEE ((0 0) , glucose_right)
Then
SET (@Glucose_right_count , to , @Glucose_right_count + 1)



MembraneMembrane

Number of methods: 1


WHILE-RUNNING ()

Put text here to explain what this method does!

Number of rules: 4 

If
SEE ((0 1) , water_right), and
IS (@Water_left_count/@Volume_left_count , > , @Water_right_count/@Volume_right_count), and
%-CHANCE (5)
Then
ERASE ((0 1)), and
MOVE ((0 -1)), and
NEW ((0 -1) , water_left), and
MOVE ((0 1))

If
SEE ((0 1) , water_right)
Then
ERASE ((0 1)), and
MOVE ((0 -1)), and
NEW ((0 -1) , water_left), and
MOVE ((0 1))

If
SEE ((0 -1) , water_left), and
IS (@Water_left_count/@Volume_left_count , < , @Water_right_count/@Volume_right_count), and
%-CHANCE (5)
Then
ERASE ((0 -1)), and
MOVE ((0 1)), and
NEW ((0 1) , water_right), and
MOVE ((0 -1))

If
SEE ((0 -1) , water_left)
Then
ERASE ((0 -1)), and
MOVE ((0 1)), and
NEW ((0 1) , water_right), and
MOVE ((0 -1))



Water_LeftWater_Left

Number of methods: 3


WHILE-RUNNING ()

Put text here to explain what this method does!

Number of rules: 8 

If
SEE ((0 0) , water_left), and
SEE ((-1 0) , air), and
IS (@left_rows , = , -1)
Then
MOVE ((1 0))

If
SEE ((0 0) , water_right), and
SEE ((-1 0) , air), and
IS (@right_rows , = , -1)
Then
MOVE ((1 0))

If
SEE ((0 0) , water_left), and
SEE ((0 1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , water_left), and
SEE ((0 -1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , water_right), and
SEE ((0 1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , water_right), and
SEE ((0 -1) , air)
Then
MOVE ((1 0))

If
SEE ((0 0) , water_left)
Then
MOVE-RANDOM-ON (water_volume)

If
SEE ((0 0) , water_right)
Then
MOVE-RANDOM-ON (volume_right)

ON (count)

Put text here to explain what this method does!

Number of rules: 2 

If
SEE ((0 0) , water_left)
Then
SET (@Water_left_count , to , @Water_left_count + 1)

If
SEE ((0 0) , water_right)
Then
SET (@Water_right_count , to , @Water_right_count + 1)

WHEN-CREATING-NEW-AGENT ()

Put text here to explain what this method does!

Number of rules: 2 

If
SEE ((0 0) , water_left)
Then
SET (@addVolumeLeft , to , @addVolumeLeft+1)

If
SEE ((0 0) , water_right)
Then
SET (@addVolumeRight , to , @addVolumeRight+1)



Water_VolumeWater_Volume

Number of methods: 3


WHILE-RUNNING ()

Put text here to explain what this method does!

Number of rules: 15 

If
IS (@addVolumeLeft , > , 0)
Then
MAKE ((0 0) , addLiquidLeft), and
SET (@addVolumeLeft , to , @addVolumeLeft - 1)

If
SEE ((0 0) , water_volume), and
SEE ((-1 0) , air), and
SEE ((0 -1) , background), and
IS (@Lleft_corner , = , 1), and
IS (@left_rows , = , -1)
Then
CHANGE ((0 0) , air), and
SET (@Volume_left_count , to , @Volume_left_count - 1), and
SET (@Lleft_corner , to , 0)

If
SEE ((0 0) , water_volume), and
SEE ((-1 0) , background), and
SEE ((0 -1) , background), and
IS (@Lleft_corner , = , 1), and
IS (@left_rows , = , -1)
Then
CHANGE ((0 0) , air), and
SET (@Volume_left_count , to , @Volume_left_count - 1), and
SET (@Lleft_corner , to , 0)

If
SEE ((0 0) , water_volume), and
SEE ((0 1) , background), and
SEE ((0 -1) , air), and
SEE ((-1 0) , air), and
IS (@Lright_corner , = , 1)
Then
CHANGE ((0 0) , air), and
SET (@Volume_left_count , to , @Volume_left_count - 1), and
SET (@Lright_corner , to , 0)

If
SEE ((0 0) , water_volume), and
SEE ((0 -1) , air)
Then
CHANGE ((0 0) , air), and
SET (@Volume_right_count , to , @Volume_right_count - 1)

If
SEE ((0 0) , volume_right), and
SEE ((0 -1) , background), and
SEE ((-1 0) , air), and
IS (@Rleft_corner , = , 1), and
IS (@right_rows , = , -1)
Then
CHANGE ((0 0) , air), and
SET (@Volume_right_count , to , @Volume_right_count - 1), and
SET (@Rleft_corner , to , 0)

If
SEE ((0 0) , volume_right), and
SEE ((0 -1) , background), and
SEE ((-1 0) , background), and
IS (@Rleft_corner , = , 1), and
IS (@right_rows , = , -1)
Then
CHANGE ((0 0) , air), and
SET (@Volume_right_count , to , @Volume_right_count - 1), and
SET (@Rleft_corner , to , 0)

If
SEE ((0 0) , volume_right), and
SEE ((0 1) , background), and
SEE ((0 -1) , air), and
IS (@Rright_corner , = , 1)
Then
CHANGE ((0 0) , air), and
SET (@Volume_right_count , to , @Volume_right_count - 1), and
SET (@Rright_corner , to , 0)

If
SEE ((0 0) , volume_right), and
SEE ((0 -1) , air)
Then
CHANGE ((0 0) , air), and
SET (@Volume_right_count , to , @Volume_right_count - 1)

If
SEE ((0 0) , air), and
SEE ((0 -1) , background), and
SEE ((1 0) , water_volume), and
IS (@Lleft_corner , = , 1), and
IS (@left_rows , = , 1)
Then
CHANGE ((0 0) , water_volume), and
SET (@Volume_left_count , to , @Volume_left_count + 1), and
SET (@Lleft_corner , to , 0)

If
SEE ((0 0) , air), and
SEE ((0 1) , background), and
SEE ((0 -1) , water_volume), and
SEE ((1 0) , water_volume), and
IS (@Lright_corner , = , 1)
Then
CHANGE ((0 0) , water_volume), and
SET (@Volume_left_count , to , @Volume_left_count + 1), and
SET (@Lright_corner , to , 0)

If
SEE ((0 0) , air), and
SEE ((0 -1) , water_volume), and
SEE ((0 1) , air)
Then
CHANGE ((0 0) , water_volume), and
SET (@Volume_left_count , to , @Volume_left_count + 1)

If
SEE ((0 0) , air), and
SEE ((0 -1) , background), and
SEE ((1 0) , volume_right), and
IS (@Rleft_corner , = , 1), and
IS (@right_rows , = , 1)
Then
CHANGE ((0 0) , volume_right), and
SET (@Volume_right_count , to , @Volume_right_count + 1), and
SET (@Rleft_corner , to , 0)

If
SEE ((0 0) , air), and
SEE ((0 1) , background), and
SEE ((0 -1) , volume_right), and
SEE ((1 0) , volume_right), and
IS (@Rright_corner , = , 1)
Then
CHANGE ((0 0) , volume_right), and
SET (@Volume_right_count , to , @Volume_right_count + 1), and
SET (@Rright_corner , to , 0)

If
SEE ((0 0) , air), and
SEE ((0 -1) , volume_right), and
SEE ((0 1) , air)
Then
CHANGE ((0 0) , volume_right), and
SET (@Volume_right_count , to , @Volume_right_count + 1)

ON (tally)

Put text here to explain what this method does!

Number of rules: 2 

If
SEE ((0 0) , water_volume)
Then
SET (@Volume_left_count , to , @Volume_left_count + 1)

If
SEE ((0 0) , volume_right)
Then
SET (@Volume_right_count , to , @Volume_right_count + 1)

ON (addLiquidLeft)

Put text here to explain what this method does!

Number of rules: 3 

If
SEE ((0 0) , air), and
SEE ((0 1) , background), and
SEE ((0 -1) , water_volume)
Then
CHANGE ((0 0) , water_volume), and
SET (@Lleft_corner , to , 1)

If
SEE ((0 0) , air), and
SEE ((0 -1) , background), and
SEE ((1 0) , water_volume), and
IS (@Lleft_corner , = , 1)
Then
CHANGE ((0 0) , water_volume), and
SET (@Lleft_corner , to , 0)

If
SEE ((0 0) , air), and
SEE ((0 -1) , water_volume)
Then
CHANGE ((0 0) , water_volume)


This report was generated using AgentSheets Version 3.0.0