Update .Net examples
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
// Copyright 2010-2021 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2010-2021 Google LLC
|
||||
// Copyright 2010-2021 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
@@ -18,7 +18,8 @@ using Google.OrTools.Sat;
|
||||
|
||||
public class NurseSolutionObserver : CpSolverSolutionCallback
|
||||
{
|
||||
public NurseSolutionObserver(IntVar[,,] shifts, int num_nurses, int num_days, int num_shifts, HashSet<int> to_print, int last_solution_explored)
|
||||
public NurseSolutionObserver(IntVar[,,] shifts, int num_nurses, int num_days, int num_shifts, HashSet<int> to_print,
|
||||
int last_solution_explored)
|
||||
{
|
||||
shifts_ = shifts;
|
||||
num_nurses_ = num_nurses;
|
||||
@@ -49,7 +50,8 @@ public class NurseSolutionObserver : CpSolverSolutionCallback
|
||||
}
|
||||
}
|
||||
}
|
||||
if (solution_count_ >= last_solution_explored_) {
|
||||
if (solution_count_ >= last_solution_explored_)
|
||||
{
|
||||
StopSearch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# .NetCoreApp examples
|
||||
The following examples showcase how to use OrTools.
|
||||
The following examples showcase how to use OrTools.<br>
|
||||
The project solution has examples for both C# and F#.
|
||||
|
||||
We recommend that all projects you create target `netcoreapp2.1`,
|
||||
@@ -9,20 +9,20 @@ keep up-to-date with the latest frameworks.
|
||||
Wherever you have or-tools installed, be sure to `PackageReference` the `Google.OrTools`
|
||||
from the project file.
|
||||
|
||||
# Execution
|
||||
Running the examples will involve building them, then running them.
|
||||
## Execution
|
||||
Running the examples will involve building them, then running them.<br>
|
||||
You can run the following command:
|
||||
```shell
|
||||
dotnet build <example>.csproj
|
||||
dotnet run --no-build --project <example>.csproj
|
||||
```
|
||||
|
||||
# Note on Google.OrTools.FSharp
|
||||
## Note on Google.OrTools.FSharp
|
||||
This part describes how to use Google.OrTools.FSharp nuget package in F#.
|
||||
|
||||
## SolverOptions and lpSolve
|
||||
This function and parameter object are a wrapper around the standard Google.OrTools functions.
|
||||
It is designed to enter the Linear/Integer program as *matrices* and *vectors*.
|
||||
### SolverOptions and lpSolve
|
||||
This function and parameter object are a wrapper around the standard Google.OrTools functions.<br>
|
||||
It is designed to enter the Linear/Integer program as *matrices* and *vectors*.
|
||||
|
||||
Two input formats are allowed:
|
||||
* Canonical Form;
|
||||
@@ -30,11 +30,10 @@ Two input formats are allowed:
|
||||
|
||||
**ALL Matrices & Vectors are entered as columns**
|
||||
|
||||
## Execution
|
||||
Running the examples will involve building them, then running them.
|
||||
### Execution
|
||||
Running the examples will involve building them, then running them.<br>
|
||||
You can run the following command:
|
||||
```shell
|
||||
dotnet build <example>.fsproj
|
||||
dotnet run --no-build --project <example>.fsproj
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2010-2021 Google LLC
|
||||
// Copyright 2010-2021 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
// Copyright 2010-2021 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Google.OrTools.Sat;
|
||||
|
||||
Reference in New Issue
Block a user