top of page

def同士でself変数の引き渡しができていないことについて

現在作成しているモデルにてエージェントpeopleのagt_stepで
def agt_step(self):
self.people_movement()
print(f"status : {self.status} point : {self.people_point}")
self.people_maintenance()
self.define_time()
self.people_return()
とprintしており、self.people_movement()の最後にも同様に
print(f"status:{self.status} point:{self.people_point}")
とprintさせているのですが、この2行の値が毎回ではないものの、一致しないときがあり、それに伴い任意の動きをしないときがあります。
この原因について教えていただきたいです。
2018-01-04 09:00:00 船1が風車18に到着
2018-01-04 09:00:00 作業員3人が風車18に到着
status:maintenance point:18
2018-01-04 09:00:00 作業員2人が風車38に到着
status:maintenance point:38
status : maintenance point : 38
[DEBUG_PEOPLE] 風車38で状態がmaintenance
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
[DEBUG_TURBINE] point:18 time:25 status:maintenance people_num3
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
2018-01-04 10:00:00 船2が風車31に到着
2018-01-04 10:00:00 作業員2人が風車31に到着
このログの風車18のところです。

現在作成しているモデルにてエージェントpeopleのagt_stepで
def agt_step(self):
self.people_movement()
print(f"status : {self.status} point : {self.people_point}")
self.people_maintenance()
self.define_time()
self.people_return()
とprintしており、self.people_movement()の最後にも同様に
print(f"status:{self.status} point:{self.people_point}")
とprintさせているのですが、この2行の値が毎回ではないものの、一致しないときがあり、それに伴い任意の動きをしないときがあります。
この原因について教えていただきたいです。
2018-01-04 09:00:00 船1が風車18に到着
2018-01-04 09:00:00 作業員3人が風車18に到着
status:maintenance point:18
2018-01-04 09:00:00 作業員2人が風車38に到着
status:maintenance point:38
status : maintenance point : 38
[DEBUG_PEOPLE] 風車38で状態がmaintenance
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
[DEBUG_TURBINE] point:18 time:25 status:maintenance people_num3
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
status : idle point : 0
2018-01-04 10:00:00 船2が風車31に到着
2018-01-04 10:00:00 作業員2人が風車31に到着
このログの風車18のところです。

bottom of page