forked from johnkerl/sack
/
test_cycle_fill.py
executable file
·64 lines (53 loc) · 1.42 KB
/
test_cycle_fill.py
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
#!/usr/bin/python -Wall
# ================================================================
# This software is released under the terms of the GNU GPL.
# Please see LICENSE.txt in the same directory as this file.
# John Kerl
# kerl.john.r@gmail.com
# 2007-05-31
# ================================================================
import pmtc_tm
import pmti_tm
import copy
# ----------------------------------------------------------------
s = pmtc_tm.from_cycles([[1,2,3],[4,5]], 6)
print s
s = pmtc_tm.from_cycle([1,2,3], 6)
print s
s = pmti_tm.from_cycles([[1,2,3],[4,5]], 6)
print s
s = pmti_tm.from_cycle([1,2,3], 6)
print s
# ----------------------------------------------------------------
s = pmtc_tm.from_cycle([1,2,3], 6); ct = s.cycle_type(); print s, ct
s = pmtc_tm.from_cycles([[1,2,3],[4,5]], 6); ct = s.cycle_type(); print s, ct
s = pmtc_tm.from_cycles([[1,2],[3],[4,5]], 6); ct = s.cycle_type(); print s, ct
print
print "random pmtcs:"
for i in range(0, 10):
pi = pmtc_tm.rand_pmtc(4)
print pi
print
print "random pmtis:"
for i in range(0, 10):
pi = pmti_tm.rand_pmti(4)
print pi
print
print "random pmtcs:"
for i in range(0, 10):
pi = pmtc_tm.rand_pmtc(20)
ct = pi.cycle_type()
print pi, ct
print
print "random pmtis:"
for i in range(0, 10):
pi = pmti_tm.rand_pmti(20)
ct = pi.cycle_type()
print pi, ct
print
print "random pmtcs:"
for i in range(0, 10):
pi = pmtc_tm.rand_pmtc(100)
ct = pi.cycle_type()
print ct
print