agentframework.py
def share_with_neighbours(self,neighbourhood):
        """Define methods for sharing with neighbours
        
        the sharing withneighbours depends on the neighbourhood distance. Distance 
        between agents are calculated. If there is an agent within the neighbourhood
        they share the food in store equally.
        """
        for agents in self.agents:  #Loop though agents in self agent
            dist = self.distance_between(agents) 
            #When distance is less than or equal to the neighourhood that is 20
            if dist <= neighbourhood: 
                sum = self.store + agents.store  
                ave = sum/2 #Average calculated by dividing sum by two
                self.store = ave
                agents.store = ave
                print (str (dist) + " " + str (ave))
Define methods for sharing with neighbours
        
        the sharing withneighbours depends on the neighbourhood distance. Distance 
        between agents are calculated. If there is an agent within the neighbourhood
        they share the food in store equally.
        
Define methods for sharing with neighbours
the sharing withneighbours depends on the neighbourhood distance. Distance
between agents are calculated. If there is an agent within the neighbourhood
they share the food in store equally.
Define methods for sharing with neighbours the sharing withneighbours depends on the neighbourhood distance . Distance between agents are calculated . If there is an agent within the neighbourhood they share the food in store equally .
def share_with_neighbours(self,neighbourhood):
        for agents in self.agents:  
            dist = self.distance_between(agents) 
            if dist <= neighbourhood: 
                sum = self.store + agents.store  
                ave = sum/2 
                self.store = ave
                agents.store = ave
                print (str (dist) + " " + str (ave))
def share_with_neighbours ( self , neighbourhood ) : for agents in self . agents : dist = self . distance_between ( agents ) if dist <= neighbourhood : sum = self . store + agents . store ave = sum / 2 self . store = ave agents . store = ave print ( str ( dist ) + " " + str ( ave ) )
Define methods for sharing with neighbours
the sharing withneighbours depends on the neighbourhood distance.
Define methods for sharing with neighbours the sharing withneighbours depends on the neighbourhood distance .
"""Define methods for sharing with neighbours
        
        the sharing withneighbours depends on the neighbourhood distance. Distance 
        between agents are calculated. If there is an agent within the neighbourhood
        they share the food in store equally.
        """ #Loop though agents in self agent #When distance is less than or equal to the neighourhood that is 20 #Average calculated by dividing sum by two
self
neighbourhood