-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelf_Test.py
More file actions
78 lines (72 loc) · 2.09 KB
/
Self_Test.py
File metadata and controls
78 lines (72 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python
# encoding: utf-8
from numpy import *
import time
from H import H
from isSamePosition import isSamePosition
from MotionModel import MotionModel
from FindList import FindList
from GetBoundary import GetBoundary
from GetObstacle import GetObstacle
from isObstacle import isObstacle
from Astar import Astar
import matplotlib.pyplot as plt
# a=mat([[3,4,5]])
# b=mat([[4,5,6]])
# print("Self Test - H cost:", H(a,b))
# c=mat([[1,2]])
# d=mat([[1,2]])
# print("Self Test - isSamePosition:", isSamePosition(c,d))
# print("Self Test - MotionModel:\n", MotionModel())
# M=mat([[9,6,3,1,2]])
# OPEN_LIST=mat([[1,2,6],
# [6,6,6],
# [7,6,6],
# [7,6,6],
# [8,6,6]])
# CLOSE_LIST=mat([[3,4,6],
# [6,6,6],
# [7,6,6],
# [7,6,6],
# [5,6,6]])
# # print(isSamePosition(OPEN_LIST[0,:],M[0,0:2]))
# print("Self Test - FindList:", FindList(M,OPEN_LIST,CLOSE_LIST))
# obstacle=GetBoundary(5)
# print("Self Test - GetBoundary:\n", obstacle)
# start_point=mat([[1,1]])
# end_point=mat([[4,4]])
# num=5
# # obstacle=GetObstacle(num,obstacle,start_point,end_point,5)
# # print("Self Test - GetObstacle:\n", obstacle)
# # e=mat([[4,2]])
# # print("Self Test - isObstacle:", isObstacle(e,obstacle))
# # start_point=mat([[1,1]])
# # end_point=mat([[4,4]])
# # print("Self Test - Astar:\n", Astar(obstacle,start_point,end_point))
# def random_pick(some_list, probabilities):
# x = random.uniform(0,1)
# print(x)
# cumulative_probability = 0.0
# for item, item_probability in zip(some_list, probabilities):
# cumulative_probability += item_probability
# print(cumulative_probability)
# if x < cumulative_probability:
# break
# return item
# try:
# last_direction_vector
# except NameError:
# last_direction_vector = mat([[0,1]])
# else:
# pass
# print(last_direction_vector)
# plt.arrow(1,1,0,0.5,head_length=0.5, head_width=0.5)
# plt.xlim(0,10)
# plt.ylim(0,10)
# # show()
# plt.show()
a=[0,1,2,3,4,5,6]
print(a[2:4])
b[0]=1
b[1]=2
print(b[0])