The code below is a plugin to this algorithm to generate path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import HTML, display | |
class Tag: | |
def __init__(self, name, value): | |
self.name = name | |
self.value = value | |
def __repr__(self): | |
return "<%s>%s</%s>"%(self.name, str(self.value), self.name) | |
class Linear: | |
def __init__(self, data): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def generate_dist_vector(size, start, tot_length, length): | |
tmp = [start] | |
count = 0 | |
l, r = -length, tot_length - length | |
for i in range(size): | |
left = tmp[0] | |
right = tmp[count] | |
left += (l*2) | |
right += (r*2) |
NewerOlder