Changeset 687 for mds-and-trees
- Timestamp:
- 09/03/17 17:37:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mds-and-trees/tree-genealogy.py
r686 r687 471 471 if len(self.tree.parents[child]) == 1: 472 472 # if current_node is the only parent 473 parent = [parfor par, v in self.tree.parents[child].items()][0]473 parent, similarity = [(par, v) for par, v in self.tree.parents[child].items()][0] 474 474 475 475 if self.JITTER: 476 dissimilarity = random.gauss(0, 0.5)476 dissimilarity = (1-similarity) + random.gauss(0, 0.5) + 0.001 477 477 else: 478 dissimilarity = 1478 dissimilarity = (1-similarity) + 0.001 479 479 add_node({'id':child, 'y':ypos, 'x': 480 480 self.xmin_crowd(self.positions[parent]['x']-dissimilarity, … … 690 690 else: 691 691 parent_id = get_id("virtual_parent") 692 inherited = 1 #(creature["Inherited"][i] if 'Inherited' in creature else 1) #ONLY FOR NOW692 inherited = (creature["Inherited"][i] if 'Inherited' in creature else 1) 693 693 self.parents[creature_id][parent_id] = inherited 694 694
Note: See TracChangeset
for help on using the changeset viewer.