Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Custom ignores for this project
runs
ga
assets
arrivals

# Logs
logs
Expand Down
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\index.js"
"program": "${workspaceFolder}\\runs\\ML\\produceData.js",
"cwd": "${workspaceFolder}\\"
}
]
}
75 changes: 75 additions & 0 deletions assets/arrivals/arrivalsOne.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
export default [
{
"name": "Nurse",
"type": "Triage Nurse",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 0
},
{
"name": "Tech",
"type": "Tech",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 1
},
{
"name": "Nurse",
"type": "Nurse",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 2
},
{
"name": "Nurse",
"type": "Greeter Nurse",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 3
},
{
"name": "Tech",
"type": "CT",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 4
},
{
"name": "Tech",
"type": "Janitorial",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 5
},
{
"name": "Tech",
"type": "Radiology",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 6
},
{
"name": "Attending",
"type": "Attending",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 7
},
{
"name": "Resident",
"type": "Resident",
"arrivalLocation": "Main Entrance",
"arrivalTick": 0,
"id": 8
},
{
"name": "patient",
"arrivalTick": 30,
"arrivalLocation": "Main Entrance",
"age": 22,
"severity": "ESI3",
"patientName": "Ashley",
"gender": "female",
"id": 9
}
]
57 changes: 57 additions & 0 deletions assets/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import arrivalHospital from "./arrivals/arrivalsOne.js"

import L1 from "./locations/_1locations.js"
import L2 from "./locations/_2locations.js"
import L3 from "./locations/_3locations.js"
import L4 from "./locations/_4locations.js"
import L5 from "./locations/_5locations.js"
import L6 from "./locations/_6locations.js"
import L7 from "./locations/_7locations.js"
import L8 from "./locations/_8locations.js"
import L9 from "./locations/_9locations.js"
import L10 from "./locations/_10locations.js"
import L11 from "./locations/_11locations.js"
import L12 from "./locations/_12locations.js"
import L13 from "./locations/_13locations.js"
import L14 from "./locations/_14locations.js"
import L15 from "./locations/_15locations.js"
import L16 from "./locations/_16locations.js"
import L17 from "./locations/_17locations.js"
import L18 from "./locations/_18locations.js"
import L19 from "./locations/_19locations.js"
import L20 from "./locations/_20locations.js"

import O1 from "./objs/_1layout.js"
import O2 from "./objs/_2layout.js"
import O3 from "./objs/_3layout.js"
import O4 from "./objs/_4layout.js"
import O5 from "./objs/_5layout.js"
import O6 from "./objs/_6layout.js"
import O7 from "./objs/_7layout.js"
import O8 from "./objs/_8layout.js"
import O9 from "./objs/_9layout.js"
import O10 from "./objs/_10layout.js"
import O11 from "./objs/_11layout.js"
import O12 from "./objs/_12layout.js"
import O13 from "./objs/_13layout.js"
import O14 from "./objs/_14layout.js"
import O15 from "./objs/_15layout.js"
import O16 from "./objs/_16layout.js"
import O17 from "./objs/_17layout.js"
import O18 from "./objs/_18layout.js"
import O19 from "./objs/_19layout.js"
import O20 from "./objs/_20layout.js"

// import bestLayout from "./objs/best.js"
// import bestLocs from "./locations/bestGen100Loc.js"

// import desTest from "./objs/desTest.js"
// import desTestLocs from "./locations/desTestLocs.js"

export default {
arrivals: [arrivalHospital],
locations: [L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L20],
objs: [O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20],
// best: [bestLayout, bestLocs],
// desTestInfo: [desTest, desTestLocs],
}
12 changes: 12 additions & 0 deletions cube.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
40 changes: 40 additions & 0 deletions cube.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Blender v2.92.0 OBJ File: ''
# www.blender.org
mtllib cube.mtl
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vt 0.625000 0.500000
vt 0.875000 0.500000
vt 0.875000 0.750000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.250000
vt 0.125000 0.500000
vt 0.375000 0.500000
vt 0.125000 0.750000
vn 0.0000 1.0000 0.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
usemtl Material
s off
f 1/1/1 5/2/1 7/3/1 3/4/1
f 4/5/2 3/4/2 7/6/2 8/7/2
f 8/8/3 7/9/3 5/10/3 6/11/3
f 6/12/4 2/13/4 4/5/4 8/14/4
f 2/13/5 1/1/5 3/4/5 4/5/5
f 6/11/6 5/10/6 1/1/6 2/13/6
2 changes: 2 additions & 0 deletions improvedER.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default
`
1 change: 1 addition & 0 deletions improvedER.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions improvedERlocations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default [
]
39 changes: 8 additions & 31 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
import { fillSpaceWithRooms } from "./src/fillSpaceWithRooms.js";
import { innerCircleLayout } from "./src/innerCircleLayout.js";
import flatGenerator from "./src/flatGenerator.js"
import wallGenerator from "./src/wallGenerator.js"
import { HLayout } from "./src/HLayout.js";
import { YLayout } from "./src/YLayout.js";
import { XLayout } from "./src/XLayout.js";
import { demo } from "./src/Demo.js";
import PerlinNoise from './node_modules/@mohayonao/perlin-noise/index.js'
import {improvedERLayout} from "./src/FloorPlans/improvedERLayout.js"


let hallWidth = 3;
let w = 100;
let l = 100;
let midRatio = 3/4;
let randAngles = randomAngles();
let maxRoomSize = 8;
let centerOpeningSize = 14;
let noiseVal = 0.543121271443701;
let i = 1;
let pn = new PerlinNoise()


// fillSpaceWithRooms("./runs/BasicFilledSpace");
innerCircleLayout("./runs/InnerCircle");
HLayout("./runs/HLayout");
// YLayout("./runs/YLayout", undefined, [0, randAngles[0], randAngles[1]], undefined);
// YLayout("./runs/YLayout", undefined, undefined, undefined);
// XLayout("./runs/XLayout");
// demo("./runs/demo");


function randomAngles() {
let angleA, angleB;
do {
angleA = Math.random() * Math.PI/3 + Math.PI/3;
angleB = Math.random() * Math.PI/3 + Math.PI/3 + angleA;
} while (angleB < Math.PI);

console.log(" > Angle 1:" + angleA)
console.log(" > Angle 2:" + angleB)
return [angleA, angleB]
}
improvedERLayout("src/FloorPlans/improvedER/", w, l, maxRoomSize, centerOpeningSize, noiseVal, i)
Loading