This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 10; | |
var numAnts = 3; | |
var randomAntIndex = [3, 6, 9]; | |
var alpha = 1.0; | |
var beta = 5.0; | |
var Q = 100; | |
var V = 0.01; | |
var randomFactor = 0.07; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 10; | |
var numAnts = 5; | |
var randomAntIndex = [1, 2, 3, 6, 9]; | |
var alpha = 1.0; | |
var beta = 5.0; | |
var Q = 100; | |
var V = 0.01 | |
var cities = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void readFile() throws IOException { | |
List<StartEndRecord> records = new ArrayList<>(); | |
long numberOfChunks = 3l; | |
try (RandomAccessFile file = new RandomAccessFile(TEST_FILE_PATH, "r")) { | |
FileChannel channel = file.getChannel(); | |
long fileSize = channel.size(); | |
MemorySegment map = channel.map(FileChannel.MapMode.READ_ONLY, 0, fileSize, Arena.global()); | |
long start = 0; | |
long chunkSize = fileSize / numberOfChunks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Unsafe UNSAFE = initUnsafe(); | |
private static Unsafe initUnsafe() { | |
try { | |
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); | |
theUnsafe.setAccessible(true); | |
return (Unsafe) theUnsafe.get(Unsafe.class); | |
} | |
catch (NoSuchFieldException | IllegalAccessException e) { | |
throw new RuntimeException(e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import collections | |
import itertools | |
import re | |
import ast | |
import functools | |
import numpy as np | |
from collections import defaultdict | |
T = "bb.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import collections | |
import itertools | |
import re | |
import ast | |
import functools | |
import numpy as np | |
from collections import defaultdict | |
T = "bb.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import collections | |
import itertools | |
import re | |
import ast | |
import functools | |
T = "bb.txt" | |
M = "aa.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import collections | |
import itertools | |
T = "bb.txt" | |
M = "aa.txt" | |
file1 = open(M, 'r') | |
Lines = file1.read().splitlines() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import collections | |
T = "bb.txt" | |
M = "aa.txt" | |
file1 = open(M, 'r') | |
Lines = file1.read().splitlines() | |
input_grid = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
T = "bb.txt" | |
M = "aa.txt" | |
file1 = open(M, 'r') | |
Lines = file1.read().splitlines() | |
sx, sy = 0, 0 | |
wx, wy = 10, 1 |
NewerOlder