Skip to content

Commit 7ae6897

Browse files
author
blueorange
committed
upload all files
0 parents  commit 7ae6897

20 files changed

+4451
-0
lines changed

__pycache__/allocation.cpython-37.pyc

12.3 KB
Binary file not shown.
10 KB
Binary file not shown.

__pycache__/globalvar.cpython-37.pyc

598 Bytes
Binary file not shown.

allo.ipynb

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 12,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import numpy as np\n",
10+
"from allocation import Node\n",
11+
"from allocation import Net\n",
12+
"from allocation import PopGene"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": 13,
18+
"metadata": {},
19+
"outputs": [],
20+
"source": [
21+
"pop = -1 + 2 * np.random.random((100, 53 * 2))\n",
22+
"netlist = [['g8', 'gp2', 'g10', 'g11', 'g13'], ['g7', 'gp3', 'g10', 'g11'],\n",
23+
" ['g6', 'gp4', 'g11'], ['g14', 'gp5', 'g1', 'g18'], ['g5', 'gp6'],\n",
24+
" ['g5', 'gp7'], ['g17', 'gp8', 'g19', 'g20', 'g22'],\n",
25+
" ['g16', 'gp9', 'g19', 'g20'], ['g15', 'gp10','g20'], ['g0', 'gp11'],\n",
26+
" ['g0', 'gp12'], ['g0', 'gp13'], ['g2', 'gp14'], ['g2', 'gp15'],\n",
27+
" ['g2', 'gp16'], ['g25', 'gp17', 'g27', 'g28', 'g30'],\n",
28+
" ['g24', 'gp18', 'g27', 'g28'], ['g23', 'gp19', 'g28'],\n",
29+
" ['gp20', 'g10', 'g5', 'g19', 'g0', 'g2', 'g27', 'g11', 'g12', 'g20', 'g21', 'g28', 'g29'],\n",
30+
" ['gp21', 'g10', 'g5', 'g19', 'g0', 'g2', 'g27', 'g11', 'g12', 'g20', 'g21', 'g28', 'g29'],\n",
31+
" ['gp0', 'g4', 'g5', 'g1', 'g0', 'g2', 'g3'],\n",
32+
" ['gp1', 'g5', 'g0', 'g2', 'g3', 'g26'], ['g4', 'g6', 'g7', 'g8'],\n",
33+
" ['g11', 'g6'], ['g9', 'g6', 'g7', 'g8'], ['g12', 'g6', 'g7', 'g8'],\n",
34+
" ['g10', 'g7'], ['g13', 'g8'], ['g1', 'g15', 'g16', 'g17'],\n",
35+
" ['g20', 'g15'], ['g18', 'g15', 'g16', 'g17'],\n",
36+
" ['g21', 'g15', 'g16', 'g17'], ['g19', 'g16'], ['g22', 'g17'],\n",
37+
" ['g3', 'g23', 'g24', 'g25'], ['g28', 'g23'],\n",
38+
" ['g26', 'g23', 'g24', 'g25'], ['g29', 'g23', 'g24', 'g25'],\n",
39+
" ['g27', 'g24'], ['g30', 'g25']]\n",
40+
"expdict = {\n",
41+
" 'g0': 65,\n",
42+
" 'g1': 53,\n",
43+
" 'g2': 65,\n",
44+
" 'g3': 53,\n",
45+
" 'g4': 52,\n",
46+
" 'g5': 64,\n",
47+
" 'g6': 6,\n",
48+
" 'g7': 6,\n",
49+
" 'g8': 6,\n",
50+
" 'g9': 2,\n",
51+
" 'g10': 6,\n",
52+
" 'g11': 7,\n",
53+
" 'g12': 4,\n",
54+
" 'g13': 3,\n",
55+
" 'g14': 1,\n",
56+
" 'g15': 6,\n",
57+
" 'g16': 6,\n",
58+
" 'g17': 6,\n",
59+
" 'g18': 3,\n",
60+
" 'g19': 6,\n",
61+
" 'g20': 7,\n",
62+
" 'g21': 4,\n",
63+
" 'g22': 3,\n",
64+
" 'g23': 6,\n",
65+
" 'g24': 6,\n",
66+
" 'g25': 6,\n",
67+
" 'g26': 3,\n",
68+
" 'g27': 6,\n",
69+
" 'g28': 7,\n",
70+
" 'g29': 4,\n",
71+
" 'g30': 3,\n",
72+
" 'gp0': 1,\n",
73+
" 'gp1': 1,\n",
74+
" 'gp2': 1,\n",
75+
" 'gp3': 1,\n",
76+
" 'gp4': 1,\n",
77+
" 'gp5': 1,\n",
78+
" 'gp6': 1,\n",
79+
" 'gp7': 1,\n",
80+
" 'gp8': 1,\n",
81+
" 'gp9': 1,\n",
82+
" 'gp10': 1,\n",
83+
" 'gp11': 1,\n",
84+
" 'gp12': 1,\n",
85+
" 'gp13': 1,\n",
86+
" 'gp14': 1,\n",
87+
" 'gp15': 1,\n",
88+
" 'gp16': 1,\n",
89+
" 'gp17': 1,\n",
90+
" 'gp18': 1,\n",
91+
" 'gp19': 1,\n",
92+
" 'gp20': 1,\n",
93+
" 'gp21': 1\n",
94+
"}"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": 14,
100+
"metadata": {},
101+
"outputs": [],
102+
"source": [
103+
"arepath = \"data\\design.are\"\n",
104+
"netpath = \"data\\design.net\""
105+
]
106+
},
107+
{
108+
"cell_type": "code",
109+
"execution_count": 15,
110+
"metadata": {},
111+
"outputs": [],
112+
"source": [
113+
"net_exp = []\n",
114+
"for i in netlist:\n",
115+
" n_exp = Net(i)\n",
116+
" net_exp.append(n_exp)\n",
117+
"# print(net_exp)"
118+
]
119+
},
120+
{
121+
"cell_type": "code",
122+
"execution_count": null,
123+
"metadata": {},
124+
"outputs": [],
125+
"source": [
126+
"pop_exp = PopGene.popExp(pop)\n",
127+
"# lstvar, _, _ = PopGene.calVar(pop)\n",
128+
"lstsum = PopGene.calLink(pop, net_exp)\n",
129+
"# 分模式计算pop的fitness \n",
130+
"fitness = PopGene.fitnessCal(pop, net_exp, 2)"
131+
]
132+
}
133+
],
134+
"metadata": {
135+
"interpreter": {
136+
"hash": "8f9bc3c36f598f1386d29f180199d47716ceae483d281506558b89a7bcf84fc2"
137+
},
138+
"kernelspec": {
139+
"display_name": "Python 3.7.9 64-bit",
140+
"language": "python",
141+
"name": "python3"
142+
},
143+
"language_info": {
144+
"codemirror_mode": {
145+
"name": "ipython",
146+
"version": 3
147+
},
148+
"file_extension": ".py",
149+
"mimetype": "text/x-python",
150+
"name": "python",
151+
"nbconvert_exporter": "python",
152+
"pygments_lexer": "ipython3",
153+
"version": "3.7.9"
154+
},
155+
"orig_nbformat": 4
156+
},
157+
"nbformat": 4,
158+
"nbformat_minor": 2
159+
}

0 commit comments

Comments
 (0)