Skip to content

Commit

Permalink
Implement rest derivatives
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtran committed Jul 8, 2023
1 parent e05089a commit ffb7c24
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Icfpc2023/LambdaScoring.fs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,32 @@ let lambda_score_MiMj_deriv_Mj(Mi: PointD, Mj: PointD, lambda: double) =
//
// #################################################

let lambda_score_Mi_borders(Mi: PointD, problem: Problem, lambda: double) =
if Mi.X < problem.StageBottomLeft.X + MUSICAL_MIN_DISTANCE:

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Unexpected symbol ':' in expression

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Unexpected symbol ':' in expression

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Unexpected symbol ':' in expression

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Unexpected symbol ':' in expression

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Unexpected symbol ':' in expression

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Unexpected symbol ':' in expression

Check failure on line 259 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.
- 1e6 * 1e3
else if Mi.X > problem.StageBottomLeft.X + problem.StageWidth - MUSICAL_MIN_DISTANCE:

Check failure on line 261 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Unexpected keyword 'elif' in binding. Expected incomplete structured construct at or before this point or other token.

Check failure on line 261 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Unexpected keyword 'elif' in binding. Expected incomplete structured construct at or before this point or other token.

Check failure on line 261 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Unexpected keyword 'elif' in binding. Expected incomplete structured construct at or before this point or other token.
- 1e6 * 1e3
else if Mi.Y < problem.StageBottomLeft.Y + MUSICAL_MIN_DISTANCE:
- 1e6 * 1e3
else if Mi.Y > problem.StageBottomLeft.Y + problem.StageWidth - MUSICAL_MIN_DISTANCE:
- 1e6 * 1e3
else
0.0

// #################################################
//
// derivative of Mi-borders interaction over Mi
//
// #################################################

let lambda_score_Mi_border_deriv(Mi: PointD, problem: Problem, lambda: double) =

Check failure on line 276 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword.

Check failure on line 276 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword.

Check failure on line 276 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword.
if Mi.X < problem.StageBottomLeft.X + MUSICAL_MIN_DISTANCE:

Check failure on line 277 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Unexpected symbol ':' in expression

Check failure on line 277 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.macos

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 277 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Unexpected symbol ':' in expression

Check failure on line 277 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.linux

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.

Check failure on line 277 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Unexpected symbol ':' in expression

Check failure on line 277 in Icfpc2023/LambdaScoring.fs

View workflow job for this annotation

GitHub Actions / main.windows

Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'.
PointD(- 1e3, 0)
else if Mi.X > problem.StageBottomLeft.X + problem.StageWidth - MUSICAL_MIN_DISTANCE:
PointD(- 1e3, 0)
else if Mi.Y < problem.StageBottomLeft.Y + MUSICAL_MIN_DISTANCE:
PointD(0, - 1e3)
else if Mi.Y > problem.StageBottomLeft.Y + problem.StageWidth - MUSICAL_MIN_DISTANCE:
PointD(0, - 1e3)
else
PointD(0, 0)

0 comments on commit ffb7c24

Please sign in to comment.