1.Import RAIN package software from store either 4.6 or 5.2.
2.First select the player
3.Then goto RAIN window at the top of file menu
4.Create New AI.
5.Next you have to select Waypoint Route from the RAIN Menu
6.Next add Waypoints how many you want. (Waypoint Rig Inspector ==> Click add(Ctrl+W))
7.Next select Navigation mesh from Rain a square-box will open adjust the box into the waypoints (RAIN==> Create Navigation Mesh)
8.Next click on generate Navigation mesh (at Inspector(NavMesh Rig Component))
9.Next open the Behavior Editor from RAIN. create New behavior tree. Give the name what you want.
10.Next from behavior tree right click create root ->Decisions ->Waypointpath or patrol.
11.Next give the name in way-point route and in move target Variable.
12.Next create->Action->move to the before node.
13.Next give the same name given in move target variable to the variable in the move and how much speed you want to move the player.
14.Finally player will move in his route.
FOR Player Detection when he goes in his range
15.select parallel node from behavior tree.
16.Next select create->Action->detect give sensor name given in which player he want to detect given in entity and Aspect name should be same in player entity in quotations("")
17.Next give the same variable given above in the move position
A wise
person will come to grief if he does the unwise acts of; giving advice to a foolish pupil, looking after a woman of loose character and keeping the company of a sad one who has lost his fortune.
According to Chanakya,
Offering advice to a stupid disciple brings more harm than
doing any good. Remember the story about a sparrow and a monkey? A Sparrow once advised a foolish monkey
who was shivering in the cold to make fire from warmth. The angry monkey killed
the sparrow for daring to counsel it. Similarly sheltering a bad woman
creates a problem and bring infamy to the provider of the shelter.
Anyone who is sad because of loss a money or health is
always lamenting and cursing his ill luck. The complaining never ends. One who
keeps company to such person also catches the sadness and becomes gloomy. His
attitude becomes negative and he begins slipping down in his own work or
profession. Besides, listening to the sad one’s constant complaints results in
terrible loss of time who has sympathetic ears for others often get cheated,
tricked into lending money or gets dragged into some misadventure which results
in his becoming another sad one.
for l in open(filename):
fields = [int(f) for f in l.split()]
vertex = fields.pop(0)
incident = [tuple(sorted([vertex, f])) for f in fields]
vertices.append(vertex)
edges.update(incident)
return vertices, list(edges)
def RandomContraction(vertices, edges):
while len(vertices) > 2:
edge = random.choice(edges)
a, b = edge
vertices.remove(b)
new_edges = []
for e in edges:
if e == edge:
continue
if b in e:
if e[0] == b:
other = e[1]
if e[1] == b:
other = e[0]
e = tuple(sorted([a, other]))
new_edges.append(e)
edges = new_edges
return vertices, edges
vertices, edges = ParseGraph(sys.argv[1])
minimum = sys.maxint
for i in range(0, 1000):
v, e = RandomContraction(vertices[:], edges[:])
print v, len(e)
if len(e) < minimum:
minimum = len(e)
#load the array with text file
fin = open(../../coresera/inversions/IntegerArray.txt)
A=[]
for line in fin:
A.append(int(line.strip()))
mearge sort : python code
import random
from sys import maxsize as inf
def merge_sort(A): def merge(L, R): m = len(L)-1 B = [] i = j = 0 inv = 0 while L[i] != inf or R[j] != inf: if L[i] <= R[j]: B.append(L[i]) i += 1 else: B.append(R[j]) inv += m - i j += 1 return B, inv n = len(A) inv = 0 if n >= 2: mid = n // 2 L, R = A[:mid], A[mid:] L, inv_left = merge_sort(L) R, inv_right = merge_sort(R) A, inv_split = merge(L + [inf], R + [inf]) inv = inv_left + inv_right + inv_split return A, inv
if __name__ == '__main__': A = [1,6,3,2,4,5] A, inv = merge_sort(A) print (inv) print (A)
# Count the number of lines in a file.
if __name__ == "__main__":
in_file = open("../../coresera/inversions/IntegerArray.txt")
line_count = 0
while True:
in_line = in_file.readline().strip()
if in_line == "":
break;
line_count += 1
in_file.close()
print("Line count:", line_count)
Ādityahṛdayam is a hymn associated with Aditya or the Sun God and was recited by the sage Agastya to Rama on the battlefield before fighting with Ravana. This historic hymn starts at the beginning of the duel between Rama and Ravana. Agastya teaches Rama, who is fatigued after the long battle with various warriors of Lanka, the procedure of worshiping the Sun god for strength to defeat the enemy. These verses belong to Yuddha Khanda , in the Ramayana as composed by Valmiki.