-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
๐ Step1 - ๊ฒฝ๋ก ์กฐํ ํ์ ์ถ๊ฐ #338
base: hugehoo
Are you sure you want to change the base?
Conversation
- PathFinder ์ธํฐํ์ด์ค๋ก ์ถ์ํ - Duration ๊ธฐ์ค ํ์ PathFinder ์์ฑ - SubwayMap -> DistancePathFinder ์์
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋
ํ์ธ์ :) ๋ง์ง๋ง ๋ฏธ์
๋ฆฌ๋ทฐ๋ฅผ ๋งก๊ฒ๋ ์ ํฌ์ ์
๋๋ค! ๋ง์ง๋ง๊น์ง ์ ๋ถํ๋๋ ค์~!
๋ฌธ์์ ์ค์ต๊ณผ 1๋จ๊ณ ๋ฏธ์
๊ตฌํ ์ ํด์ฃผ์
จ์ต๋๋ค! ๐
๋ช๊ฐ์ง ์กฐ๊ธ ๋ ์ฐธ๊ณ ํด๋ณด์๋ฉด ์ข์ ๋ถ๋ถ์ ์ฝ๋ฉํธ๋ก ์ถ๊ฐํ๋๋ฐ์, ํ์ธ๋ถํ๋๋ ค์!
private List<Line> lines; | ||
|
||
public SubwayMap(List<Line> lines) { | ||
public DistancePathFinder(List<Line> lines) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DistancePathFinder์ DurationPathFinder์ ๋ก์ง์ด Section์ ์ด๋ค ๊ฐ์ ์ฌ์ฉํ๋์ง๋ง ๋ค๋ฅด๊ณ ๊ฑฐ์ ๋์ผํ๋ฐ์,
์ค๋ณต์ ์ ๊ฑฐํ๋ ๋ฆฌํฉํ ๋ง์ ๋์ ํด๋ณด์๋ฉด ์ด๋จ๊น์? ํ๊ฐ์ง ๋ฐฉ๋ฒ์ผ๋ก๋ enum์ ์กฐ๊ธ ๋ ํ์ฉํด๋ณด์
๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค :)
int ์ต์์๊ฐ = Math.min(๊ฒฝ๋ก_1_์ต์์๊ฐ, ๊ฒฝ๋ก_2_์ต์์๊ฐ); | ||
assertThat(duration).isEqualTo(์ต์์๊ฐ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ
์คํธ ์ฝ๋์์๋ ๋ก์ง์ ์ฌ์ฉํ๋ ๊ฒ๋ณด๋ค ํ๋์ฝ๋ฉ๋ ๊ฐ์ผ๋ก ๊ฒ์ฆํด๋ณด์๋ฉด ์ด๋จ๊น์?
https://jojoldu.tistory.com/615
.when().get("/paths?source={sourceId}&target={targetId}&searchType={type}", source, target, type) | ||
.then().log().all().extract(); | ||
} | ||
|
||
private ExtractableResponse<Response> ๋_์ญ์_์ต๋จ_๊ฑฐ๋ฆฌ_๊ฒฝ๋ก_์กฐํ๋ฅผ_์์ฒญ(Long source, Long target) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PathSteps์ ํ์ฉํ์ฌ ์ค๋ณต์ ์ค์ฌ๋ณผ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค~!
|
||
@DisplayName("Subway Path TEST ๋ฌธ์ํ") | ||
public class PathDocumentation extends Documentation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ ํ๋ถํ ๋ฌธ์๋ฅผ ์ํด์ ์ค๋ํซ์ ํ์ฉํด์ ๋ฌธ์๋ฅผ ์ปค์คํ ํด๋ณด์๋ฉด ์ด๋จ๊น์?!
import nextstep.subway.domain.SectionEdge; | ||
import nextstep.subway.domain.Station; | ||
|
||
public class DistancePathFinder implements PathFinder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ก ์์ฑํด์ฃผ์ ์ฝ๋์ ๋ํด์ ๋จ์ํ ์คํธ๋ฅผ ์์ฑํด๋ณด์๋ฉด ์ด๋จ๊น์?!
} | ||
|
||
/** | ||
* Circular ๊ฒฝ๋ก๋ ์์ฑ ๋ถ๊ฐ. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์ฑํด์ฃผ์ จ๋ ์ธ์์กฐ๊ฑด์ ์ญ์ ํ์ ์ด์ ๊ฐ ์์ผ์ค๊น์? ๐ข
์๋ ํ์ธ์ ๋ฆฌ๋ทฐ์ด๋
์๊ฐ์ด ๋ง์ด ๋ฆ์์ง๋ง, ๋ฆ๊ฒ๋ผ๋ ์์ฃผํ๊ณ ์ PR ์ฌ๋ฆฝ๋๋ค.
๊ณผ์ ์ด ๋๋ฌ์์๋ ๋ฆฌ๋ทฐ ํด์ฃผ์ ์ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค!