def create_state(self, proportion):
        """Create an environmental state."""
        if random.random() < 0.5:
            proportion = 1 - proportion
        State(origin=self, contents=proportion)
def create_state ( self , proportion ) : if random . random ( ) < 0.5 : proportion = 1 - proportion State ( origin = self , contents = proportion )
Create an environmental state.