-
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
π 3λ¨κ³ - μκΈ μ μ± μΆκ° #488
base: moonstal1506
Are you sure you want to change the base?
Conversation
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.
μμ λ λ§μ§λ§κΉμ§ λ§μ μ ν΄μ£Όμ ¨λλ°!! λ¦¬λ·°κ° λ¦μλ€μ π
λ¨Όμ , λ―Έμ
μ¬μ΄ν΄μ λ무 μ ꡬνν΄ μ£Όμ
μ 리뷰νκΈ°κ° νΈνμ΄μ. π―
λͺκ°μ§ μ½λ©νΈ λ¨κ²¨λμλλ° νμΈ λΆνλλ €μ.
λ°μμ νμλ‘ νμ§ μμΌμ
λ λλλ°, μ¬μ κ° λμ λ€λ©΄ λ°μν΄λ³΄μ
λ μ’μμ!!π
리뷰μμ² μ£Όμλ©΄ λ¨Έμ§νλλ‘ ν κ²μ! κ³ μ λ§μΌμ
¨μ΅λλ€ πββοΈ
public Line(String name, String color, int extraFare, Section section) { | ||
this(name, color, section); | ||
this.extraFare = extraFare; | ||
} |
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.
Line40μ extraFare λ μ£Όμμ±μμμ μ΄κΈ°νλ₯Ό ν΄μ£Όμ΄μΌ ν κ² κ°μλ°, 보쑰μμ±μμμ μ΄κΈ°νλ₯Ό ν΄μ£Όκ³ μλ€μ.
[μλ κ°νΈ μ€λΈμ νΈ] 1-2μ₯ μμ±μ νλλ₯Ό μ£Ό μμ±μλ‘ λ§λμΈμ κΈμ μ°Έκ³ νμλ©΄ μ’μ κ² κ°μ΅λλ€!
(+ νμ¬ μ£Όμμ±μλ ν μ€νΈ μ½λμμλ§ μ¬μ©λκ³ μλλ° μ κ±°νκ³ , 보쑰μμ±μλ₯Ό μ£Όμμ±μλ‘ λ§λ€λ©΄ μ΄λ¨λΌμ?)
@@ -9,11 +10,13 @@ public class Path { | |||
private List<Station> stations; | |||
private int distance; | |||
private int duration; | |||
private List<Line> usedLine; |
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.
Aμμμ CμκΉμ§μ κ²½λ‘λΌκ³ νλ©΄ Aμ ---------> Bμ ---------> Cμ
μΌλ‘ λ³Ό μλ μμ§λ§,
Aμ -----μ λΆλΉμ -----> Bμ -----2νΈμ ------> Cμ
μΌλ‘ μκ°ν μλ μμ κ² κ°μμ.
μ΄λ² λ¨κ³μ λ
Έμ μΆκ°μκΈ μ μ±
μΌλ‘ μΈν΄ usedLine κ° μΆκ°λμλ€μ π
λ€λ₯Έ λ°©λ²μΌλ‘λ stations λμ μ sections(ꡬκ°)λ₯Ό λ£μ΄μ€λ€λ©΄ usedLineμ λ³λλ‘ λ§λ€μ§ μμλ λ κ² κ°μμ!
μ΄ λ°©λ²μ μ΄λ μ κ°μ?
κ²½λ‘(Path)λ κ²°κ΅ κ΅¬κ°λ€(Sections)μ μΌκΈμ»¬λ μ
μΌλ‘ λ³Ό μ μμ κ² κ°μμ!
(μ΄λ κ² λ§λ λ€λ©΄ distanceμ duration νλλ μ κ±°κ° κ°λ₯ν©λλ€ π)
@@ -1,19 +1,42 @@ | |||
package nextstep.path.fare; | |||
|
|||
import java.util.Objects; | |||
|
|||
public class Fare { |
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.
κ°κ°μ²΄ π―
|
||
@DisplayName("λμ΄μ λ°λΌ μκΈμ ν μΈνλ€") | ||
@ParameterizedTest | ||
@CsvSource({"6, 450", "13, 720", "19, 1250"}) |
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.
κ²½κ³κ΅¬κ° ν μ€νΈ π―
|
||
@DisplayName("μκΈ λνκΈ°") | ||
@Test | ||
void plus() { |
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.
λλ©μΈ λͺ¨λΈμ λν ν μ€νΈλ μ ν΄μ£Όμ ¨λ€μ π
λ§μ§λ§κΉμ§ 리뷰ν΄μ£Όμ
μ κ°μ¬ν©λλ€π |
private List<Station> stations; | ||
private int distance; | ||
private int duration; | ||
private List<PathSection> pathSections; | ||
|
||
public Path(List<Station> stations, int distance, int duration) { | ||
public Path(List<Station> stations, List<PathSection> pathSections) { | ||
this.stations = stations; | ||
this.distance = distance; | ||
this.duration = duration; | ||
this.pathSections = pathSections; | ||
} |
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.
stations λμ sections(ꡬκ°) μΆκ°μ λν νΌλλ°±μ λ°κ³
- μμ±μλ‘
pathSections
λ§ λ°μμ μλ΅κ°(PathResponse)μ νμνgetStations()
λ₯Ό ꡬννλ λ°©λ²κ³Ό - SubwayMapμ findPathμμ path.getVertexList()λ₯Ό νλ©΄ stationsλ₯Ό λ°λ‘ μ»μ μ μλ€λ μ μμ stationsμ pathSectionsλ₯Ό λ°λ λ°©λ²μ΄ κ³ λ―Όλμμ΅λλ€!
public Path findPath(Station source, Station target, PathType pathType) {
GraphPath<Station, PathSection> path = getGraphPath(source, target, pathType);
return new Path(path.getVertexList(), path.getEdgeList());
}
1λ²μ stations ꡬνλ λ‘μ§μ νλ² λ μμ±ν΄μΌ νλ€λ μ ,
2λ²μ pathSectionλ‘λ ꡬν κ°λ₯νλ° stationsλ₯Ό λ λ°λλ€λ μ μμ
μ΄λ€ λ°©μμ κ³ λ₯΄λ©΄ μ’μκΉμπ€
μλ νμΈμ μ€μ€λ!
μ λ² νΌλλ°± μμΈνκ² μ€λͺ ν΄μ£Όμ μ κ°μ¬νμ΅λλ€π
νΌλλ°± μ μ©ν΄μ μ½λ μμ νμ΅λλ€!
λ λ¦μμ§λ§.. λκΉμ§ μνλ©΄ ννν κ² κ°μμ PR μ¬λ €λ΄ λλ€..γ γ
νΉμλΌλ μκ°μ΄ λμ λ€λ©΄ 리뷰 λΆνλ립λλ€πββοΈ
κ°μ¬ν©λλ€!!