Maximum penetration!
A Pen by Jamie Coulter on CodePen.
| #include <iostream> | |
| #include <cstdint> | |
| #include <functional> | |
| #include <string> | |
| #include <optional> | |
| //using F = std::function<int(int,int)>; | |
| template <typename RType, typename DummyType = int64_t, | |
| typename PType = int32_t, | 
| #!/usr/bin/env python3 | |
| """Development In Progress | |
| CVRPTW. | |
| or-tools == 9.9.3963 | |
| python == 3.11.7 | |
| Number of Regular Nodes = 16, | |
| Depot Nodes = 1 | 
| #!/usr/bin/env python3 | |
| """ | |
| Having a cost different if a node is visited last or along the route | |
| """ | |
| from ortools.constraint_solver import routing_enums_pb2 | |
| from ortools.constraint_solver import pywrapcp | |
| def create_data_model(): | 
| #!/usr/bin/env python3 | |
| """Solve a multiple knapsack problem using the CP-SAT solver.""" | |
| from ortools.sat.python import cp_model | |
| def main(): | |
| data = {} | |
| data["weights"] = [48, 30, 42, 36, 36, 48, 42, 42, 36, 24, 30, 30, 42, 36, 36] | |
| data["values"] = [10, 30, 25, 50, 35, 30, 15, 40, 30, 35, 45, 10, 20, 30, 25] | |
| assert len(data["weights"]) == len(data["values"]) | |
| data["num_items"] = len(data["weights"]) | 
| ```sh | |
| $ sysctl hw.optional | |
| hw.optional.arm.FEAT_FlagM: 1 | |
| hw.optional.arm.FEAT_FlagM2: 1 | |
| hw.optional.arm.FEAT_FHM: 1 | |
| hw.optional.arm.FEAT_DotProd: 1 | |
| hw.optional.arm.FEAT_SHA3: 1 | |
| hw.optional.arm.FEAT_RDM: 1 | |
| hw.optional.arm.FEAT_LSE: 1 | |
| hw.optional.arm.FEAT_SHA256: 1 | 
| #!/usr/bin/env python3 | |
| '''Simple test | |
| ''' | |
| from ortools.sat.python import cp_model | |
| import pandas as pd | |
| # Define the dataframe with feature columns and the target column | |
| data = { | |
| 'A': [1.59, 0.9, 2.82,2.44,2.61], | |
| 'B': [0.68,0.1,1.3,1.64,1.59], | 
| #include <cstdio> | |
| #include <iostream> | |
| #include <filesystem> | |
| #include <fstream> | |
| namespace fs = std::filesystem; | |
| int main() | |
| { | |
| const std::string filename = std::tmpnam(nullptr); | 
| #!/usr/bin/env python3 | |
| """Vehicles Routing Problem (VRP). | |
| Some point are on the same physical location | |
| No more than two vehicle to visit a physical location | |
| """ | |
| from ortools.constraint_solver import routing_enums_pb2 | |
| from ortools.constraint_solver import pywrapcp | |
| // Based on the GDC 2017 talk "Math for Game Programmers: Noise-Based RNG" | |
| // https://www.youtube.com/watch?v=LWFzPP8ZbdU&ab_channel=GDC | |
| const BIT_NOISE1 = 0xB5297A4D | |
| const BIT_NOISE2 = 0x68E31DA4 | |
| const BIT_NOISE3 = 0x1B56C4E9 | |
| const PRIME1 = 198491317 | |
| const PRIME2 = 6542989 | |
| class Squirrel3 { | 
Maximum penetration!
A Pen by Jamie Coulter on CodePen.