Open Kilda Java Documentation
generator.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 # Copyright 2017 Telstra Open Source
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 
17 from random import randint
18 
19 count = 1
20 while 1000 > count:
21  print('CREATE (Location'+str(count)+':Location { name: "Location '+ str(count) +'" })')
22  count += 1
23 
24 count = 1
25 print('create')
26 while 1000 > count:
27  rnd = count
28  while rnd == count:
29  rnd = (randint(1,999))
30 
31  print('(Location'+str(count)+')-[:CONNECTED_TO { distance: 1 }]->(Location'+str(rnd)+'),')
32  print('(Location'+str(rnd)+')-[:CONNECTED_TO { distance: 1 }]->(Location'+str(count)+'),')
33  count += 1
34 
35 count = 1
36 while 999 > count:
37  rnd = count + 1
38 
39  print('(Location'+str(count)+')-[:CONNECTED_TO { distance: 1 }]->(Location'+str(rnd)+'),')
40  print('(Location'+str(rnd)+')-[:CONNECTED_TO { distance: 1 }]->(Location'+str(count)+'),')
41  count += 1
42