Changeset 627
- Timestamp:
- 10/26/16 19:13:26 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mds-and-trees/tree-genealogy.py
r626 r627 64 64 'width': { 65 65 'meaning': 'adepth', 66 'start': 1,66 'start': 0.1, 67 67 'end': 4, 68 68 'bias': 3 … … 585 585 ids = {} 586 586 def get_id(id): 587 if not idin ids:587 if id not in ids: 588 588 ids[id] = len(ids) 589 589 return ids[id] … … 624 624 # make sure that ID's of parents are lower than that of their children 625 625 for i in range(0, len(creature["FromIDs"])): 626 get_id(creature["FromIDs"][i]) 626 if creature["FromIDs"][i] not in ids: 627 get_id("virtual_parent") 627 628 628 629 creature_id = get_id(creature["ID"]) … … 635 636 # we assign to each parent its contribution to the genotype of the child 636 637 for i in range(0, len(creature["FromIDs"])): 637 parent_id = get_id(creature["FromIDs"][i]) 638 if creature["FromIDs"][i] in ids: 639 parent_id = get_id(creature["FromIDs"][i]) 640 else: 641 parent_id = get_id("virtual_parent") 638 642 inherited = 1 #(creature["Inherited"][i] if 'Inherited' in creature else 1) #ONLY FOR NOW 639 643 self.parents[creature_id][parent_id] = inherited
Note: See TracChangeset
for help on using the changeset viewer.