"""food activity - kind of EnergyBeing (http://an.org/programming/being.py), to study food production, distribution and use, in FoodWorld(s) (http://studio.kyperjokki.fi/FirstAndLast/FoodWorld) TheRealWorld IsA FoodWorld, shouldn't we get rid of AbsolutePoverty ? http://en.wikipedia.org/wiki/Poverty_line#Absolute_poverty This work was inspired by the movie The girl in the cafe , )http://www.thegirlinthecafe.com/ featuring the G8 group and their Millennium programme. .. saw it from tv the day before yesterday, and talked about it with my wife yestarday, and got inspired by it to work on so that started today. http://www.makepovertyhistory.org/ (k) antont : origin: http://an.org/programming/food.py """ from human import Woman, Man def test_mother(): print "Testing motherhood, using basic human behaviour." mother = Woman("Mother X") #a female, but sexes not in play here now child = mother.give_birth() assert mother.is_child(child) #here time could pass, but not necessary now assert child.hungry mother.food = 2 #here just to ensure minimum now print "Mother has a hungry child, %s, but enough food: %d" % (child, mother.food) """having two units avoids the dilemma of self vs child here, though we might say mother puts child before herself, that is not the point here - this just to ensure basic reason.""" mother.act() #this supposes that child expresses hunger so mom knows assert not child.hungry assert not mother.hungry #as there was the other food too print "SUCCESS: after mother acted, both child and mother are fed" def test_groups(): return poor = Group(10) #ten people poor.food = 3 #not even close to enough food rich = Group(10) rich.food = 200 #very much more than immediate need """NOTE: in this thing there is no money, for the sake of simplicity, but that is perhaps good to also indicate different realms of reality: food is real (popper world 1), money is imaginary (world 3)""" """first we assume it is normal, human, to help. at least in this kind of an extreme situation.""" assert poor.hungry #was gonna say .in_need or something, but perhaps this individual - group identicality is interesting here? poor.act() #are individual (and adult) - must express their need (request help) rich.act() assert not poor.hungry assert not rich.hungry """all kinds of more complex situations must be considered, 'must' as in they exist in TheRealWorld: * fear for own continued survival (want/need of reserve) * dislike / hatred / fear / .. between groups - war is an extreme case, where causing hunger is a weapon even * trade / economy: getting something in exchange for food """ def test_farming(): """ 11:52 < [Infinity]> Yes! Like the war games the government does to conquer virtual threats to the country! 11:52 < antont> referring again to the prob that even with money it is not easy to make good things happen 11:52 < antont> right! 11:52 < [Infinity]> However they actually had a wargame about something like Katrina a few onths before it hit... And did it help? 11:52 < [Infinity]> months* 11:53 < [Infinity]> It may have helped a bit... Personally i htink that the entire tradgedy was the fault of stubborn floridans. 11:53 < [Infinity]> think* 11:53 < antont> also with the non-trivial structures we now have in place .. like that european kingdoms took gold and diamonds from africa and are rich, poor countries owe money to them, so they must grow coffee and tobacco that they can sell to europe to get money to pay the loan interest, so they can't grow food for themselves 11:54 < antont> actuall test_farmer() is the function i've been thinking of writing next, that 'whether to grow tobacco or food' decision :) """ def test_father(): #does this bring any new perspective w.r.t to mother? father = Man("Father X") mother = Woman("Mother X") mother.have_sex(father, fertilization=True) #seems that now be brought sex etc into play, out of the blue :o assert mother.pregnant assert mother.pregnant_to is father print "Inited fatherhood test: %s is pregnant for %s" % (mother, father) child = mother.give_birth() assert mother.is_child(child) assert father.is_child(child) #humans ought to care that much. print "After child birth, %s is a father to %s" % (father, child) #here time could pass, but not necessary now mother.food = 0 assert child.hungry assert mother.hungry father.food = 3 #here just to ensure minimum now print "Whole family is hungry, but father has enough food:", father.food """having three units avoids the dilemma of self vs family here, though we might say a good father puts family before himself, that is not the point here - this just to ensure basic reason.""" father.act() #this supposes that parents communicate and act sensibly assert not child.hungry assert not mother.hungry assert not father.hungry #as there was the other food too print "After the father acted, all three are fed:", child, mother, father """now, if/when there are cases of scarce resources, either by having not enough for the family, or there being also others in need, we get the interesting questions. in fact, when in test_groups above i was originally thinking of large groups (like USA, EU, Africa, ..), or perhaps smaller primitive ones like tribes, similar dilemmas would work with the smallest units, families, too. not going to that yet, just layed some groundwork...""" #put implementation here if __name__ == '__main__': test_mother() test_groups() test_farming() test_father()