Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
adc2018-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
adc2018
adc2018-system
Commits
18ac9db1
Commit
18ac9db1
authored
Aug 30, 2018
by
tawada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
e9b9174c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
route.cpp
resolver/cpp/route.cpp
+16
-14
No files found.
resolver/cpp/route.cpp
View file @
18ac9db1
...
...
@@ -9,7 +9,6 @@
extern
Board
*
board
;
bool
routing
(
int
trgt_line_id
){
Line
*
trgt_line
=
board
->
line
(
trgt_line_id
);
trgt_line
->
clearTrack
();
...
...
@@ -255,6 +254,8 @@ bool routing(int trgt_line_id){
}
if
(
!
update
)
continue
;
// コストマップの更新があった場合
if
(
trgt_box
->
isTypeNumber
()){
if
(
trgt_box
->
getIndex
()
==
trgt_line_id
){
if
(
trgt_ibox
->
cost
<
goal_cost
)
goal_cost
=
trgt_ibox
->
cost
;
...
...
@@ -296,6 +297,7 @@ bool routing(int trgt_line_id){
}
}
//コストマップは完成したのでバックトラック
int
now_x
=
trgt_line
->
getSinkX
();
int
now_y
=
trgt_line
->
getSinkY
();
int
now_z
=
trgt_line
->
getSinkZ
();
...
...
@@ -330,7 +332,6 @@ bool routing(int trgt_line_id){
case
DOWN
:
// 下へ
now_z
=
now_z
-
1
;
next_id
=
trgt_d
.
c_d
;
break
;
}
while
(
1
){
Point
p
=
{
now_x
,
now_y
,
now_z
};
...
...
@@ -340,6 +341,7 @@ bool routing(int trgt_line_id){
trgt_d
=
my_board
[
now_z
][
now_y
][
now_x
].
d
;
switch
(
next_id
){
case
NORTH
:
if
(
!
trgt_d
.
n
)
next_id
=
-
1
;
...
...
@@ -399,28 +401,28 @@ bool isInserted(int x,int y,int z){
int
cost_parallel
(
int
trgt_line_id
,
int
x
,
int
y
,
int
z
){
//同Z平面上で隣接する(延べ)配線数をカウント
Box
*
neibour_box
;
int
cost
=
0
;
int
p_
cost
=
0
;
if
(
x
-
1
>=
0
){
neibour_box
=
board
->
box
(
x
-
1
,
y
,
z
);
if
(
neibour_box
->
checkLine
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
cost
++
;
if
(
neibour_box
->
isTypeNumber
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
p_
cost
++
;
}
if
(
x
+
1
<
board
->
getSizeX
()){
neibour_box
=
board
->
box
(
x
+
1
,
y
,
z
);
if
(
neibour_box
->
checkLine
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
cost
++
;
if
(
neibour_box
->
isTypeNumber
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
p_
cost
++
;
}
if
(
y
-
1
>=
0
){
neibour_box
=
board
->
box
(
x
,
y
-
1
,
z
);
if
(
neibour_box
->
checkLine
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
cost
++
;
if
(
neibour_box
->
isTypeNumber
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
p_
cost
++
;
}
if
(
y
+
1
<
board
->
getSizeY
()){
neibour_box
=
board
->
box
(
x
,
y
+
1
,
z
);
if
(
neibour_box
->
checkLine
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
cost
++
;
if
(
neibour_box
->
isTypeNumber
()
&&
neibour_box
->
getIndex
()
!=
trgt_line_id
)
p_
cost
++
;
}
return
cost
;
return
p_
cost
;
}
void
recordLine
(
int
trgt_line_id
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment