Skip to content

Commit

Permalink
[cps] [space] [subway] SubwaySpace
Browse files Browse the repository at this point in the history
- Node = Station
- Edge = `TakeLine: { oldStation, line, newStation }`
  • Loading branch information
xieyuheng committed Aug 25, 2024
1 parent 1bf1726 commit 334aedb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 1 addition & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[cps] [space] [subway] `SubwaySpace` & `createSubwaySpace`

- Node = Station
- Edge = `TakeLine: { oldStation, line, newStation }`
[cps] [space] [subway] `createSubwaySpace`

[cps] [space] add debug options

Expand Down
2 changes: 1 addition & 1 deletion src/problems/subway/Subway.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type LineId = string
export type StationId = string
export type LineId = string

export type Position = { x: number; y: number }

Expand Down
10 changes: 10 additions & 0 deletions src/problems/subway/SubwaySpace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { type Space } from "../../solvers/cps"

Check failure on line 1 in src/problems/subway/SubwaySpace.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

Check failure on line 1 in src/problems/subway/SubwaySpace.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
import { type LineId, type Station, type StationId } from "./Subway.js"

export type TakeLine = {
start: StationId
line: LineId
end: StationId
}

export type SubwaySpace = Space<Station, TakeLine>
File renamed without changes.
1 change: 1 addition & 0 deletions src/problems/subway/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./Subway.js"
export * from "./SubwaySpace.js"

0 comments on commit 334aedb

Please sign in to comment.