From d6dd91e15016231f92075f767b8adc4695869bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20=C5=81ukasik?= Date: Mon, 27 Apr 2020 20:04:11 +0200 Subject: [PATCH 1/5] zmiany --- frontend/img/Down.png | Bin 0 -> 560 bytes frontend/img/Left.png | Bin 0 -> 567 bytes frontend/img/Right.png | Bin 0 -> 574 bytes frontend/img/Up.png | Bin 0 -> 509 bytes frontend/index.html | 102 ++-------------------------- frontend/js/Agent.js | 87 ++++++++++++++++++++++++ frontend/js/Board.js | 30 +++++++++ frontend/js/Field.js | 22 ++++++ frontend/js/main.js | 27 ++++++++ frontend/js/script.js | 125 ++++++++++++++++++++++++++++++++++ frontend/script.js | 148 ----------------------------------------- frontend/styles.css | 35 ++++++---- 12 files changed, 318 insertions(+), 258 deletions(-) create mode 100644 frontend/img/Down.png create mode 100644 frontend/img/Left.png create mode 100644 frontend/img/Right.png create mode 100644 frontend/img/Up.png create mode 100644 frontend/js/Agent.js create mode 100644 frontend/js/Board.js create mode 100644 frontend/js/Field.js create mode 100644 frontend/js/main.js create mode 100644 frontend/js/script.js delete mode 100644 frontend/script.js diff --git a/frontend/img/Down.png b/frontend/img/Down.png new file mode 100644 index 0000000000000000000000000000000000000000..44308b3203e7047aa24bb6dad14c66dae4684f68 GIT binary patch literal 560 zcmV-00?+-4P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D03mcmSad^jWnpw_ zZ*Cw|X>DZyGB7eQIxsXkGB+SGI65^oIx;h~Qs5{600EduL_t(&L+zNm62l-21nvC) zKRcQsg(n!$;{?)}ZITLZ(Lv$!x~{{A^E`k5+IZ}aSK^q|0As+EbS5?SJOCw>%pFTA zlahzb9bLB1?^lku524#aGo=YKe~3bgr!?P(5N#?`TH;gSZ!J(-=u=<@;3_TmDR5%2 zl!EvahGE3dLwv?cp+;2bM;a&v^eJ?Ly{vd)M^tFVd*$N9x0QPRpm)h~UM8hE^^;Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D03mcmSad^jWnpw_ zZ*Cw|X>DZyGB7eQIxsXkGB+SGI65^oIx;h~Qs5{600Ey#L_t(&L+#nyZp0uAMbTvb z|DQ8wM8qKO7X!A%ercbAS3N~hdq2-}>FV=-Rn#F#=#V6&khI|vzwi6~F4p)w>qvP? zSodJlNv)Ew)(Iz)#xZX7bI!URXg#R@f%ID<$9NS7Cf?F)4=Nr(Nm}4B?LoQ+{YeTiruT!V#`CN7we@s5 z#nbn@^tO>Nfou(3mukUG+JeE}IAz%qEH%JKjJ002ovPDHLk FV1l3I_lf`j literal 0 HcmV?d00001 diff --git a/frontend/img/Right.png b/frontend/img/Right.png new file mode 100644 index 0000000000000000000000000000000000000000..edce10b0b49b34dd5b8c4c142fc4eb64fbc60fb0 GIT binary patch literal 574 zcmV-E0>S->P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D03mcmSad^jWnpw_ zZ*Cw|X>DZyGB7eQIxsXkGB+SGI65^oIx;h~Qs5{600E{+L_t(&L+zT~4#F@9MmOL8 zohOE+YS$my0)?jMMlXzT`Y~M0&g;64wRqjH3$c|vu%HspdN|MXe)rFm-P5m>)5xKw z*R0fP@B@T02doCgVkMSy8fT=9KP4kRNOv>l2Je?XtMA=|sfZ$)?l4TJ z6lgl`Tgh@n2)#oeDIr8FPf7sA>a!l~Pu-Kk!f=*Spb&#sB_Lu?72J^M=u zWXc&hQ!2|Kw-V)}(;+tLCMEizf0Zl;)zq7Vlv>X^e(u54-;{lW6Q^Wn{JJ|aI(Q=| zn||PC*7&i^NIIn{m6H zrW6>DOHKx9RtmJbNt*=vl>%iqHIo2?k~OI7!4X@@16#=h%PAel8{o6UAG1IE9{>OV M07*qoM6N<$f^N|B?EnA( literal 0 HcmV?d00001 diff --git a/frontend/img/Up.png b/frontend/img/Up.png new file mode 100644 index 0000000000000000000000000000000000000000..c71a34835986d85135aef485eb5e19d74948d845 GIT binary patch literal 509 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0g_2XK~!i%?a;xt z!ypJn(f1CdmrxtghbPNgxB8ubLlI?j4S6*nrblV$1{_=iwJM)aECM^Qy!{FKN9C^Ry7M_3xvy0q9y#3VzxzU~VG zQletVGAA*b7)4w5Noi2DrSXlS^r(BXPs)V4Coev!pmFX0SKht^rEB}7WGG$RCnZDa z+CC{6O4k-Rso?n=(75*Elc;;LPs)V4C+!amB}UPfeNq|}ZRvhvG$kr_taMUAKr)o; z8(o|XwJxo9QbAY(6dIA;od8t?#HT-s5;B_WAHsSuj1+=69##!1$OVU5Y$ zZ~&qwctkiMZkk(AK{X|Y{rD#ql)c1LcgOJs=AQXjhEVlz00000NkvXXu0mjfHhSH9 literal 0 HcmV?d00001 diff --git a/frontend/index.html b/frontend/index.html index e51cf90..f65b762 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,108 +2,18 @@ + Inteligentny wózek - + - +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
+
+ \ No newline at end of file diff --git a/frontend/js/Agent.js b/frontend/js/Agent.js new file mode 100644 index 0000000..1a51fc2 --- /dev/null +++ b/frontend/js/Agent.js @@ -0,0 +1,87 @@ +export default class Agent{ + constructor(positionX, positionY, turn){ + this.positionX = positionX; + this.positionY = positionY; + this.turn = turn; + } + + getParams(){ + let params = {}; + + positionX = this.positionX; + positionY = this.positionY; + turn = this.turn; + + params = {positionX, positionY, turn}; + + return params; + } + + goForward(){ + if(this.turn == 'Up'){ + this.positionY += 1; + } + else if(this.turn == 'Down'){ + this.positionY -= 1; + } + else if(this.turn == 'Left'){ + this.positionX -= 1; + } + else if(this.turn == 'Right'){ + this.positionX += 1; + } + } + + turnLeft(){ + if(this.turn == 'Up'){ + this.turn = 'Left'; + } + else if(this.turn == 'Down'){ + this.turn = 'Right'; + } + else if(this.turn == 'Left'){ + this.turn = 'Down'; + } + else if(this.turn == 'Right'){ + this.turn = 'Up' + } + } + + turnRight(){ + if(this.turn == 'Up'){ + this.turn = 'Right'; + } + else if(this.turn == 'Down'){ + this.turn = 'Left'; + } + else if(this.turn == 'Left'){ + this.turn = 'Up'; + } + else if(this.turn == 'Right'){ + this.turn = 'Down' + } + } + + showAgent(){ + console.log(this.turn) + if(this.turn === "Up"){ + document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Up.png')"; + } + else if(this.turn === "Down"){ + document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Down.png')"; + } + else if(this.turn === "Right"){ + document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Right.png')"; + } + else if(this.turn === "Left"){ + document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Left.png')"; + } + + } + + hideAgent(){ + document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = ""; + } + + +} \ No newline at end of file diff --git a/frontend/js/Board.js b/frontend/js/Board.js new file mode 100644 index 0000000..178bfb1 --- /dev/null +++ b/frontend/js/Board.js @@ -0,0 +1,30 @@ +import Field from './Field.js' + +export function createBoard(rangeX, rangeY){ + const board = []; + + for(let y = 0; y < rangeY; y++){ + const row = []; + for(let x = 0; x < rangeX; x++){ + let field = new Field(x, y, false, false, 1); + row.push(field) + } + board.push(row) + } + return board +} + +export function showBoard(board){ + for(let y = board.length - 1; y >= 0 ; y--){ + document.getElementById("board").innerHTML += "
"; + + for(let x = 0; x < board[y].length; x++){ + document.getElementById("row-" + y).innerHTML += "
" + } + } +} + + + + + diff --git a/frontend/js/Field.js b/frontend/js/Field.js new file mode 100644 index 0000000..7e2b03b --- /dev/null +++ b/frontend/js/Field.js @@ -0,0 +1,22 @@ +export default class Field{ + constructor(x, y, isShelf, isOccupiedByAgent, costOfTravel){ + this.xField = x; + this.yField = y; + this.isShelf = isShelf; + this.isOccupiedByAgent = isOccupiedByAgent; + this.costOfTravel = costOfTravel; + } + + getParams(){ + let params = {}; + + xField = this.xField; + yField = this.yField; + isShelf = this.isShelf; + isOccupiedByAgent = this.isOccupiedByAgent; + costOfTravel = this.costOfTravel; + params = {xField, yField, isShelf, isOccupiedByAgent, costOfTravel} + + return params; + } +} \ No newline at end of file diff --git a/frontend/js/main.js b/frontend/js/main.js new file mode 100644 index 0000000..735d905 --- /dev/null +++ b/frontend/js/main.js @@ -0,0 +1,27 @@ +import * as Board from './Board.js' +import Agent from './Agent.js' + +let board = Board.createBoard(10,10); +Board.showBoard(board); + +let agent = new Agent(0,0, 'Right'); + +agent.showAgent(); + + + + + + + + + + + + + + + + + + diff --git a/frontend/js/script.js b/frontend/js/script.js new file mode 100644 index 0000000..44ad711 --- /dev/null +++ b/frontend/js/script.js @@ -0,0 +1,125 @@ +// import Agent from './Agent.js' + +// //Klasy + + +// class Field { +// constructor(x, y, isEmpty) { +// this.xField = x; +// this.yField = y; +// this.isFieldEmpty = isEmpty; +// } +// getCoordinates(){ +// return this.xField + this.yField; +// } + +// getStatus(){ +// return this.isFieldEmpty; +// } +// } + +// class Product { +// constructor(name, type, farcing, price) { +// this.name = name; +// this.type = type; +// this.farcing = farcing; +// this.price = price +// } +// } + +// class Rack{ +// constructor(noOfShelf, typOfProduct) { +// this.noOfShelf = noOfShelf; +// } + +// addShelf(){ +// this.noOfShelf = this.noOfShelf + 1; +// } + +// isEmpty(){ +// if (this.noOfShelf === 0){ +// return true; +// }else { +// return false; +// } +// } +// } + +// class Shelf { +// constructor(number) { +// this.number = number; +// } +// } + + +// //Objekty i zmienne +// var regaly = ['1-1', '1-3', '1-4', '1-6', '1-7', '1-9', '2-1', '2-9', '3-3', '3-4', '3-6', '3-7', '4-1', '4-9', '5-1', '5-3', '5-4', '5-6', '5-7', '5-9'] +// const agent1 = new Agent(3, 0); + +// //Funkcja uruchamiająca prace calego scriptu +// function start(){ +// //ponumerujPola(); +// pokolorujRegaly(); +// umiescAgenta(agent1); +// droga(agent1); +// } + +// //Funkcja kolorujaca miejsca na planszy gdzie znajduja sie regaly +// function pokolorujRegaly(){ +// let x; +// for(x = 0; x < regaly.length; x++){ +// document.getElementById(regaly[x]).className = 'regal'; +// } +// } + +// //Funkcja wyswietlajaca id pol +// function ponumerujPola(){ +// let x,y +// for(x = 0; x < 7; x++){ +// for(y = 0; y < 11; y++){ +// id = x.toString() + "-" + y.toString(); +// document.getElementById(id).innerHTML = id; +// } +// } +// } + +// //Funkcja usuwająca agenta z pola, przed przemieszczeniem +// function usunAgenta(agent){ +// document.getElementById(agent.getId()).style.backgroundImage = "none"; +// } + + +// //Funckja wyswietlajaca agenta gdy ten zmieni polozenie +// function umiescAgenta(agent) { +// document.getElementById(agent.getId()).style.backgroundImage = "url('Agent.jpg')"; +// } + +// //Funkcja zmieniajaca polozenie agenta o 1 pole +// function przemieszczenie(side, time, agent){ +// const lastPosition = agent.getId(); +// setTimeout(function(){ +// usunAgenta(agent) +// if(side == "left") +// agent.left(); +// if(side == "right") +// agent.right(); +// if(side == "up") +// agent.up(); +// if(side == "down") +// agent.down(); +// umiescAgenta(agent); +// }, time); +// } + +// //Funkcja ktora ustala droge agenta do przebycia +// function droga(agent) { +// przemieszczenie("right", 1000, agent); +// przemieszczenie("right", 2000, agent); +// przemieszczenie("up", 3000, agent); +// przemieszczenie("right", 4000, agent); +// przemieszczenie("right", 5000, agent); +// przemieszczenie("right", 6000, agent); +// przemieszczenie("right", 7000, agent); +// przemieszczenie("right", 8000, agent); +// przemieszczenie("right", 9000, agent); +// } diff --git a/frontend/script.js b/frontend/script.js deleted file mode 100644 index 29cbec8..0000000 --- a/frontend/script.js +++ /dev/null @@ -1,148 +0,0 @@ -//Klasy -class Agent { - constructor(x, y){ - this.xField = x; - this.yField = y; - } - - getId(){ - return this.xField + "-" + this.yField; - } - - right(){ - this.yField++; - } - - left(){ - this.yField--; - } - - up(){ - this.xField--; - } - - down(){ - this.xField++; - } -} - -class Field { - constructor(x, y, isEmpty) { - this.xField = x; - this.yField = y; - this.isFieldEmpty = isEmpty; - } - getCoordinates(){ - return this.xField + this.yField; - } - - getStatus(){ - return this.isFieldEmpty; - } -} - -class Product { - constructor(name, type, farcing, price) { - this.name = name; - this.type = type; - this.farcing = farcing; - this.price = price - } -} - -class Rack{ - constructor(noOfShelf, typOfProduct) { - this.noOfShelf = noOfShelf; - } - - addShelf(){ - this.noOfShelf = this.noOfShelf + 1; - } - - isEmpty(){ - if (this.noOfShelf === 0){ - return true; - }else { - return false; - } - } -} - -class Shelf { - constructor(number) { - this.number = number; - } -} - - -//Objekty i zmienne -var regaly = ['1-1', '1-3', '1-4', '1-6', '1-7', '1-9', '2-1', '2-9', '3-3', '3-4', '3-6', '3-7', '4-1', '4-9', '5-1', '5-3', '5-4', '5-6', '5-7', '5-9'] -const agent1 = new Agent(3, 0); - -//Funkcja uruchamiająca prace calego scriptu -function start(){ - //ponumerujPola(); - pokolorujRegaly(); - umiescAgenta(agent1); - droga(agent1); -} - -//Funkcja kolorujaca miejsca na planszy gdzie znajduja sie regaly -function pokolorujRegaly(){ - let x; - for(x = 0; x < regaly.length; x++){ - document.getElementById(regaly[x]).className = 'regal'; - } -} - -//Funkcja wyswietlajaca id pol -function ponumerujPola(){ - let x,y - for(x = 0; x < 7; x++){ - for(y = 0; y < 11; y++){ - id = x.toString() + "-" + y.toString(); - document.getElementById(id).innerHTML = id; - } - } -} - -//Funkcja usuwająca agenta z pola, przed przemieszczeniem -function usunAgenta(agent){ - document.getElementById(agent.getId()).style.backgroundImage = "none"; -} - - -//Funckja wyswietlajaca agenta gdy ten zmieni polozenie -function umiescAgenta(agent) { - document.getElementById(agent.getId()).style.backgroundImage = "url('Agent.jpg')"; -} - -//Funkcja zmieniajaca polozenie agenta o 1 pole -function przemieszczenie(side, time, agent){ - const lastPosition = agent.getId(); - setTimeout(function(){ - usunAgenta(agent) - if(side == "left") - agent.left(); - if(side == "right") - agent.right(); - if(side == "up") - agent.up(); - if(side == "down") - agent.down(); - umiescAgenta(agent); - }, time); -} - -//Funkcja ktora ustala droge agenta do przebycia -function droga(agent) { - przemieszczenie("right", 1000, agent); - przemieszczenie("right", 2000, agent); - przemieszczenie("up", 3000, agent); - przemieszczenie("right", 4000, agent); - przemieszczenie("right", 5000, agent); - przemieszczenie("right", 6000, agent); - przemieszczenie("right", 7000, agent); - przemieszczenie("right", 8000, agent); - przemieszczenie("right", 9000, agent); -} diff --git a/frontend/styles.css b/frontend/styles.css index 877c58c..0fbed01 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -1,33 +1,39 @@ +body { + padding: 0; + margin: 0; +} + .container{ width: 100%; height: 100%; + min-width: 1920px; + min-height: 1080px; position: absolute; - background-color: grey; + background-color: rgb(37, 36, 36); } -.plansza{ - width: 1100px; - height:700px; +#board{ + width: 700px; + height: 700px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); - background-color: lightyellow; - + background-color: white; } .row{ - width: 1100px; - height: 100px; + width: 100%; + height: 70px; display: flex; flex-direction: row; } -.pole{ - height: 100px; - width: 100px; - background-color: lightyellow; +.field{ + height: 70px; + width: 70px; + background-color: white; background-image: none; background-size: cover; border-color: black; @@ -43,8 +49,8 @@ } .regal{ - height: 100px; - width: 100px; + height: 50px; + width: 50px; color: lightyellow; background-color: darkslategrey; border-color: black; @@ -57,3 +63,4 @@ justify-content: center; align-items: center; } + From 85229deb0a8285904111092e512c89174b33c5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20=C5=81ukasik?= Date: Tue, 28 Apr 2020 12:00:21 +0200 Subject: [PATCH 2/5] porzadki --- frontend/index.html | 2 +- frontend/js/Agent.js | 87 ----------------------------- frontend/js/Board.js | 30 ---------- frontend/js/Field.js | 22 -------- frontend/js/main.js | 9 +-- frontend/js/script.js | 125 ------------------------------------------ 6 files changed, 6 insertions(+), 269 deletions(-) delete mode 100644 frontend/js/Agent.js delete mode 100644 frontend/js/Board.js delete mode 100644 frontend/js/Field.js delete mode 100644 frontend/js/script.js diff --git a/frontend/index.html b/frontend/index.html index f65b762..16e6a53 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -8,7 +8,7 @@ - +
diff --git a/frontend/js/Agent.js b/frontend/js/Agent.js deleted file mode 100644 index 1a51fc2..0000000 --- a/frontend/js/Agent.js +++ /dev/null @@ -1,87 +0,0 @@ -export default class Agent{ - constructor(positionX, positionY, turn){ - this.positionX = positionX; - this.positionY = positionY; - this.turn = turn; - } - - getParams(){ - let params = {}; - - positionX = this.positionX; - positionY = this.positionY; - turn = this.turn; - - params = {positionX, positionY, turn}; - - return params; - } - - goForward(){ - if(this.turn == 'Up'){ - this.positionY += 1; - } - else if(this.turn == 'Down'){ - this.positionY -= 1; - } - else if(this.turn == 'Left'){ - this.positionX -= 1; - } - else if(this.turn == 'Right'){ - this.positionX += 1; - } - } - - turnLeft(){ - if(this.turn == 'Up'){ - this.turn = 'Left'; - } - else if(this.turn == 'Down'){ - this.turn = 'Right'; - } - else if(this.turn == 'Left'){ - this.turn = 'Down'; - } - else if(this.turn == 'Right'){ - this.turn = 'Up' - } - } - - turnRight(){ - if(this.turn == 'Up'){ - this.turn = 'Right'; - } - else if(this.turn == 'Down'){ - this.turn = 'Left'; - } - else if(this.turn == 'Left'){ - this.turn = 'Up'; - } - else if(this.turn == 'Right'){ - this.turn = 'Down' - } - } - - showAgent(){ - console.log(this.turn) - if(this.turn === "Up"){ - document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Up.png')"; - } - else if(this.turn === "Down"){ - document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Down.png')"; - } - else if(this.turn === "Right"){ - document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Right.png')"; - } - else if(this.turn === "Left"){ - document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Left.png')"; - } - - } - - hideAgent(){ - document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = ""; - } - - -} \ No newline at end of file diff --git a/frontend/js/Board.js b/frontend/js/Board.js deleted file mode 100644 index 178bfb1..0000000 --- a/frontend/js/Board.js +++ /dev/null @@ -1,30 +0,0 @@ -import Field from './Field.js' - -export function createBoard(rangeX, rangeY){ - const board = []; - - for(let y = 0; y < rangeY; y++){ - const row = []; - for(let x = 0; x < rangeX; x++){ - let field = new Field(x, y, false, false, 1); - row.push(field) - } - board.push(row) - } - return board -} - -export function showBoard(board){ - for(let y = board.length - 1; y >= 0 ; y--){ - document.getElementById("board").innerHTML += "
"; - - for(let x = 0; x < board[y].length; x++){ - document.getElementById("row-" + y).innerHTML += "
" - } - } -} - - - - - diff --git a/frontend/js/Field.js b/frontend/js/Field.js deleted file mode 100644 index 7e2b03b..0000000 --- a/frontend/js/Field.js +++ /dev/null @@ -1,22 +0,0 @@ -export default class Field{ - constructor(x, y, isShelf, isOccupiedByAgent, costOfTravel){ - this.xField = x; - this.yField = y; - this.isShelf = isShelf; - this.isOccupiedByAgent = isOccupiedByAgent; - this.costOfTravel = costOfTravel; - } - - getParams(){ - let params = {}; - - xField = this.xField; - yField = this.yField; - isShelf = this.isShelf; - isOccupiedByAgent = this.isOccupiedByAgent; - costOfTravel = this.costOfTravel; - params = {xField, yField, isShelf, isOccupiedByAgent, costOfTravel} - - return params; - } -} \ No newline at end of file diff --git a/frontend/js/main.js b/frontend/js/main.js index 178bb7e..8534d3a 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -110,7 +110,7 @@ class Field{ } } -//funckcje +//funkcje function createBoard(rangeX, rangeY){ const board = []; @@ -136,12 +136,13 @@ function showBoard(board){ } } -let board = createBoard(10,10); -let agent = new Agent(0,0, 'Right'); function start(){ + let board = createBoard(10,10); + let agent = new Agent(0,0, 'Right'); showBoard(board); - agent.showAgent(); + agent.showAgent() + } diff --git a/frontend/js/script.js b/frontend/js/script.js deleted file mode 100644 index 44ad711..0000000 --- a/frontend/js/script.js +++ /dev/null @@ -1,125 +0,0 @@ -// import Agent from './Agent.js' - -// //Klasy - - -// class Field { -// constructor(x, y, isEmpty) { -// this.xField = x; -// this.yField = y; -// this.isFieldEmpty = isEmpty; -// } -// getCoordinates(){ -// return this.xField + this.yField; -// } - -// getStatus(){ -// return this.isFieldEmpty; -// } -// } - -// class Product { -// constructor(name, type, farcing, price) { -// this.name = name; -// this.type = type; -// this.farcing = farcing; -// this.price = price -// } -// } - -// class Rack{ -// constructor(noOfShelf, typOfProduct) { -// this.noOfShelf = noOfShelf; -// } - -// addShelf(){ -// this.noOfShelf = this.noOfShelf + 1; -// } - -// isEmpty(){ -// if (this.noOfShelf === 0){ -// return true; -// }else { -// return false; -// } -// } -// } - -// class Shelf { -// constructor(number) { -// this.number = number; -// } -// } - - -// //Objekty i zmienne -// var regaly = ['1-1', '1-3', '1-4', '1-6', '1-7', '1-9', '2-1', '2-9', '3-3', '3-4', '3-6', '3-7', '4-1', '4-9', '5-1', '5-3', '5-4', '5-6', '5-7', '5-9'] -// const agent1 = new Agent(3, 0); - -// //Funkcja uruchamiająca prace calego scriptu -// function start(){ -// //ponumerujPola(); -// pokolorujRegaly(); -// umiescAgenta(agent1); -// droga(agent1); -// } - -// //Funkcja kolorujaca miejsca na planszy gdzie znajduja sie regaly -// function pokolorujRegaly(){ -// let x; -// for(x = 0; x < regaly.length; x++){ -// document.getElementById(regaly[x]).className = 'regal'; -// } -// } - -// //Funkcja wyswietlajaca id pol -// function ponumerujPola(){ -// let x,y -// for(x = 0; x < 7; x++){ -// for(y = 0; y < 11; y++){ -// id = x.toString() + "-" + y.toString(); -// document.getElementById(id).innerHTML = id; -// } -// } -// } - -// //Funkcja usuwająca agenta z pola, przed przemieszczeniem -// function usunAgenta(agent){ -// document.getElementById(agent.getId()).style.backgroundImage = "none"; -// } - - -// //Funckja wyswietlajaca agenta gdy ten zmieni polozenie -// function umiescAgenta(agent) { -// document.getElementById(agent.getId()).style.backgroundImage = "url('Agent.jpg')"; -// } - -// //Funkcja zmieniajaca polozenie agenta o 1 pole -// function przemieszczenie(side, time, agent){ -// const lastPosition = agent.getId(); -// setTimeout(function(){ -// usunAgenta(agent) -// if(side == "left") -// agent.left(); -// if(side == "right") -// agent.right(); -// if(side == "up") -// agent.up(); -// if(side == "down") -// agent.down(); -// umiescAgenta(agent); -// }, time); -// } - -// //Funkcja ktora ustala droge agenta do przebycia -// function droga(agent) { -// przemieszczenie("right", 1000, agent); -// przemieszczenie("right", 2000, agent); -// przemieszczenie("up", 3000, agent); -// przemieszczenie("right", 4000, agent); -// przemieszczenie("right", 5000, agent); -// przemieszczenie("right", 6000, agent); -// przemieszczenie("right", 7000, agent); -// przemieszczenie("right", 8000, agent); -// przemieszczenie("right", 9000, agent); -// } From bed895d67d3db3a66fe4ac68a32738b9ae7b2e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20=C5=81ukasik?= Date: Tue, 28 Apr 2020 13:49:03 +0200 Subject: [PATCH 3/5] funckja getDistane --- frontend/index.html | 3 +-- frontend/js/main.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 16e6a53..572efd6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -13,7 +13,6 @@
-
- +
\ No newline at end of file diff --git a/frontend/js/main.js b/frontend/js/main.js index b234ee4..8fd4b03 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -64,7 +64,6 @@ class Agent{ } showAgent(){ - console.log(this.turn) if(this.turn === "Up"){ document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Up.png')"; } @@ -228,16 +227,24 @@ function showBoard(board){ } } +function getDistance(x1,y1,x2,y2){ + var a = x1 - x2; + var b = y1 - y2; + var c = Math.sqrt(a*a + b*b); + return c +} + + let board = createBoard(10,10); board = createShelf(board); let agent = new Agent(0,0, 'Right'); function start(){ - let board = createBoard(10,10); - let agent = new Agent(0,0, 'Right'); showBoard(board); - agent.showAgent() + agent.showAgent(); + + console.log(getDistance(2,1,0,3)) } From da71a683f405eca7fa5f363b152370c120d19344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20=C5=81ukasik?= Date: Tue, 28 Apr 2020 14:00:39 +0200 Subject: [PATCH 4/5] zmiany --- frontend/Agent.jpg | Bin 37219 -> 0 bytes frontend/js/main.js | 8 +++----- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 frontend/Agent.jpg diff --git a/frontend/Agent.jpg b/frontend/Agent.jpg deleted file mode 100644 index 6f2e344ce4abc76595fba414fd4a6f8363324347..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37219 zcmeIb2Urx%)-KxP03%s)W+W&|juHe041gd4Dmjc~0RfSyzzm8Cl7oVx1Vu$fKm;T+ zWJE+H$dF+GCCdyF2AFUgzx{>1|L=d!_MW@Xx#u}F^ibWb>F#=KRjs#Hb*-WfP$z(W zhI*&;00_7xL6QJ~iaQ*AGQ`6T0E~?RNdN%$0(1Z)um?;X1P`1b>;M!@L%<&ZqVUK0 zXo%v^G$$xi807)b{FDLqHqHwIFz_4`cx(XxY>{v>z%By22<#&8 ze>{v>z%BxRAn?y@LqS19Srz!ZbKn=~Akcqs3OdkZ!Vl1b=Rn^H z+g*sjAL&PsL;sKg{VaPRzk5&Ep6=Q6dzxqXA2+}7+xLN=f2jl1Vc5yfBLsPzEbUZ4kLP!JJd4;uu^2B9_sa4@&DJKiM- znCag($Q~#SEgftxJp&^sP__@uF%-Io21-jy1GaGmYOiz_)@xk1ms&BM#bf8e0Rp~I5ODo0e+)HRNuIH{*^aLVx9d2EJo{-LM0?@K>+U~mXGIW_(D+sy3TJYnU>>e~7SadT@YUpx8yef!&d zv4Q#8Lqh|lf$iiAvL_hap=>m?A_{cux@Is(KMqmF>w7tmB|k21pchj*i|2B>(#^mv zu8ccC*vZ<@oc((lyYc@jXMbeu&wLF5Oi&0|cu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m4`N$VPx(nSt@Y#ujo2FY z$$De)x*{iq>z&@Lf(s3cgA27Tx%+)H#>JoAgyHSHERUiIt!L4oITwFdmNtLlHgA@P zi^y5EzBD&20Q$1165$Fb9!N~AQ*^NQazK<<;^8+o=t91W9e(MMXLpj3b@U|_$Vv(2 zvZS$GFlihgMB^+Qf~>;?CXC_7Yk(JZ3F9BDpjn!mj0P~oSdr>%jM;#*lAN54X)PDlA;%u$={)0_B04YNJYB1Gy)kPIKI&xt?7`{E*^*PZK2y z`YS9amv3rISL4C46GS*}$%)RpADiqw0<+YEOXXdDZQSXh*W#`Wbv?=jh01FKw+aPt5zu zE?O$I@E%PYV{Q_GG;!A}%F}}WgmB1&+-(#W(f0B4SR9q4Hf^ kiA(l_1XNjHVbG8Mh`m@(fR0w
" else - document.getElementById("row-" + y).innerHTML += "
" + document.getElementById("row-" + y).innerHTML += "
"+ board[y][x].costOfTravel + "
" } } } @@ -349,10 +349,8 @@ let shelfs = createShelf(); let agent = new Agent(0,0, 'Right'); function start(){ - showBoard(board); - agent.showAgent(); - - console.log(getDistance(2,1,0,3)) + showBoard(board); + console.log(board); } From 8a58a491b8a65e3785386f7d0e49a4f96cc5428f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20=C5=81ukasik?= Date: Tue, 28 Apr 2020 19:44:49 +0200 Subject: [PATCH 5/5] a* implementacja --- frontend/index.html | 1 + frontend/js/Archiwum/script.js | 32 ++--- frontend/js/main.js | 218 +++++++++++++++++++++++++++++---- frontend/styles.css | 18 +++ 4 files changed, 228 insertions(+), 41 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 572efd6..02e4c87 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -13,6 +13,7 @@
+ \ No newline at end of file diff --git a/frontend/js/Archiwum/script.js b/frontend/js/Archiwum/script.js index 44ad711..f05939a 100644 --- a/frontend/js/Archiwum/script.js +++ b/frontend/js/Archiwum/script.js @@ -94,22 +94,22 @@ // document.getElementById(agent.getId()).style.backgroundImage = "url('Agent.jpg')"; // } -// //Funkcja zmieniajaca polozenie agenta o 1 pole -// function przemieszczenie(side, time, agent){ -// const lastPosition = agent.getId(); -// setTimeout(function(){ -// usunAgenta(agent) -// if(side == "left") -// agent.left(); -// if(side == "right") -// agent.right(); -// if(side == "up") -// agent.up(); -// if(side == "down") -// agent.down(); -// umiescAgenta(agent); -// }, time); -// } +//Funkcja zmieniajaca polozenie agenta o 1 pole +function przemieszczenie(side, time, agent){ + const lastPosition = agent.getId(); + setTimeout(function(){ + usunAgenta(agent) + if(side == "left") + agent.left(); + if(side == "right") + agent.right(); + if(side == "up") + agent.up(); + if(side == "down") + agent.down(); + umiescAgenta(agent); + }, time); +} // //Funkcja ktora ustala droge agenta do przebycia // function droga(agent) { diff --git a/frontend/js/main.js b/frontend/js/main.js index c19a521..4bd3526 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -16,22 +16,7 @@ class Agent{ params = {positionX, positionY, turn}; return params; - } - - goForward(){ - if(this.turn == 'Up'){ - this.positionY += 1; - } - else if(this.turn == 'Down'){ - this.positionY -= 1; - } - else if(this.turn == 'Left'){ - this.positionX -= 1; - } - else if(this.turn == 'Right'){ - this.positionX += 1; - } - } + } turnLeft(){ if(this.turn == 'Up'){ @@ -83,6 +68,21 @@ class Agent{ document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = ""; } + goForward(){ + if(this.turn == 'Up'){ + this.positionY += 1; + } + else if(this.turn == 'Down'){ + this.positionY -= 1; + } + else if(this.turn == 'Left'){ + this.positionX -= 1; + } + else if(this.turn == 'Right'){ + this.positionX += 1; + } + } + } @@ -93,6 +93,11 @@ class Field{ this.isShelf = isShelf; this.isOccupiedByAgent = isOccupiedByAgent; this.costOfTravel = costOfTravel; + this.neighbors = []; + this.gScore = 0; + this.heuristic = 0; + this.f = 0; + this.previous = undefined; } getParams(){ @@ -122,7 +127,13 @@ class Field{ setCostOfTravel(costOfTravel){ this.costOfTravel = costOfTravel; - } + } + + setNeighbors(field){ + if(field.isShelf == false){ + this.neighbors.push(field) + } + } } class Shelf{ @@ -179,7 +190,8 @@ class Candy{ } } -//funckcje + +//funkcje function createBoard(rangeX, rangeY){ const board = []; @@ -332,11 +344,162 @@ function showBoard(board){ } } -function getDistance(x1,y1,x2,y2){ - var a = x1 - x2; - var b = y1 - y2; - var c = Math.sqrt(a*a + b*b); - return c +function getDistance(field, goalField){ + // var a = field.xField - goalField.xField; + // var b = field.yField - goalField.yField; + // var c = Math.sqrt(a*a + b*b); + var d = Math.abs(field.xField - goalField.xField) + Math.abs(field.yField - goalField.yField) + return d +} + +function addNeighbors(board){ + for(var y = 0; y < 10; y++){ + for(var x = 0; x < 10; x++){ + var leftNeigbor, rightNeighbor, topNeighbor, bottomNeighbor; + if(x > 0){ + leftNeigbor = board[y][x - 1]; + board[y][x].setNeighbors(leftNeigbor); + } + if(x < board[y].length - 1){ + rightNeighbor = board[y][x + 1]; + board[y][x].setNeighbors(rightNeighbor); + } + if(y > 0){ + bottomNeighbor = board[y - 1][x]; + board[y][x].setNeighbors(bottomNeighbor); + } + if(y < board.length - 1){ + topNeighbor = board[y + 1][x]; + board[y][x].setNeighbors(topNeighbor); + } + } + } +} + +function colorGreen(field){ + document.getElementById(field.xField + "-" + field.yField).style.backgroundColor = "green"; +} + +function colorRed(field){ + document.getElementById(field.xField + "-" + field.yField).style.backgroundColor = "red"; +} + +function colorYellow(field){ + document.getElementById(field.xField + "-" + field.yField).style.backgroundColor = "yellow"; +} + +function addNeighborsToOpenSet(set, neigbors){ + for(x = 0; x < neigbors.length; x++){ + set.push(neigbors[x]); + colorGreen(neigbors[x]); + } +} + +function addToClosedSet(set, field){ + set.push(field); + colorRed(field); +} + + +function addToOpenSet(set, field){ + set.push(field); + colorGreen(field); +} + +function calculateFScore(field, goalField){ + let fscore, distanceToGoal, costOfTravel; + distanceToGoal = getDistance(field, goalField); + costOfTravel = field.costOfTravel; + fscore = costOfTravel + distanceToGoal; + return fscore; +} + +function findLowestFScore(openSet, goalField){ + let bestField = openSet[0]; + for(var x = 1; x < openSet.length; x++){ + if(calculateFScore(openSet[x], goalField) < calculateFScore(bestField, goalField)){ + bestField = openSet[x]; + } + } + return bestField; +} + +function removeFromSet(openSet, promisingField){ + for(var x = openSet.length - 1; x >= 0; x--){ + if(openSet[x] == promisingField){ + openSet.splice(x,1); + } + } +} + +function sleep(milliseconds) { + const date = Date.now(); + let currentDate = null; + do { + currentDate = Date.now(); + } while (currentDate - date < milliseconds); + } + +function aStar(startField, goalField){ + let closedSet = []; + let openSet = []; + var path; + + addToOpenSet(openSet, startField) + + while(openSet.length > 0){ + + let current = findLowestFScore(openSet, goalField); + + if(current === goalField){ + path = [] + var temp = current; + path.push(temp); + while(temp.previous){ + path.push(temp.previous); + temp = temp.previous + } + console.log("A* COMPLETED"); + + for(var i = 0; i < path.length; i++){ + colorYellow(path[i]); + } + return path + } + + removeFromSet(openSet, current); + addToClosedSet(closedSet, current); + + var neighbors = current.neighbors; + + for(var i = 0; i < neighbors.length; i++){ + + var neighbor = neighbors[i]; + + if(!closedSet.includes(neighbor)){ + var tempG = current.gScore + neighbor.costOfTravel; + + if(openSet.includes(neighbor)){ + if(tempG < neighbor.gScore){ + neighbor.gScore = tempG; + } + } else { + neighbor.gScore = tempG; + addToOpenSet(openSet, neighbor); + } + + neighbor.heuristic = getDistance(neighbor, goalField); + neighbor.f = neighbor.gScore + neighbor.heuristic; + neighbor.previous = current; + + } + } + } +} + +function executePath(agent, path){ + + } @@ -345,12 +508,17 @@ board = createShelfOnBoard(board); board = createCostofField(board, 10, 10); let candy = new Candy('zelek', 'truskawkowy', 'Jumbo', 541); let shelfs = createShelf(); - let agent = new Agent(0,0, 'Right'); +var button = document.getElementById("testButton"); +addNeighbors(board); + function start(){ showBoard(board); - console.log(board); + + let path = aStar(board[0][0], board[7][7]); + //console.log(path); } + diff --git a/frontend/styles.css b/frontend/styles.css index 68a91c8..22d0510 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -83,3 +83,21 @@ body { align-items: center; } +#buttonContainer{ + width: 100%; + height: 150px; + display: flex; + align-items: center; + +} + + +#testButton{ + height:100px; + width:200px; + margin: -20px -50px; + position:relative; + top:30px; + left:48%; +} +