Toggle navigation
Toggle navigation
This project
Loading...
Sign in
kkl
/
Probability Death
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이승규
2019-06-05 17:22:18 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ab48f5bede14844395bb7d173edb8a882d7cd99c
ab48f5be
1 parent
cd6b6b75
사망요인리스트에 요인이 하나만 들어있을 때 오류해결
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
app.js
lib/socketio.js
routes/index.js
app.js
View file @
ab48f5b
...
...
@@ -22,10 +22,10 @@ app.use(express.urlencoded({ extended: false }));
app
.
use
(
cookieParser
());
app
.
use
(
'/'
,
express
.
static
(
path
.
join
(
__dirname
,
'public'
)));
app
.
use
(
'/'
,
express
.
static
(
path
.
join
(
__dirname
,
'code'
)));
app
.
use
(
'/Cname/:
C
name/Cbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'public'
)));
app
.
use
(
'/Cname/:
C
name/Cbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'code'
)));
app
.
use
(
'/Fname/:
F
name/Fbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'newpublic'
)));
app
.
use
(
'/Fname/:
F
name/Fbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'newcode'
)));
app
.
use
(
'/Cname/:name/Cbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'public'
)));
app
.
use
(
'/Cname/:name/Cbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'code'
)));
app
.
use
(
'/Fname/:name/Fbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'newpublic'
)));
app
.
use
(
'/Fname/:name/Fbirth'
,
express
.
static
(
path
.
join
(
__dirname
,
'newcode'
)));
app
.
use
(
'/'
,
indexRouter
);
...
...
lib/socketio.js
View file @
ab48f5b
...
...
@@ -162,7 +162,7 @@ module.exports = (server, app) => {
//죽을 확률 계산(내맘대로 커스텀)
info
.
death_prob
=
(
(
info
.
heat
/
50
)
+
(
Math
.
abs
(
info
.
sensible_temperature
-
15
)
/
10
)
+
(
info
.
discomport
/
10
)
+
(
info
.
UV
/
10
)
+
info
.
windspd
*
1
+
(
info
.
rain
/
10
)
+
(
Math
.
abs
(
info
.
current_temperature
-
15
)
/
10
)
+
info
.
windspd
*
1
+
(
info
.
rain
/
10
)
+
(
Math
.
abs
(
info
.
current_temperature
-
15
)
/
10
)
+
(
info
.
traffic
/
5
)
);
// ------------------------------ death_factor 정의 ------------------------------
...
...
@@ -182,7 +182,7 @@ module.exports = (server, app) => {
Death_Factors
.
push
(
"심장마비로 사망"
);
//반드시 하나의 요인은 추가되어야 함
info
.
death_factor
=
Death_Factors
[
Math
.
round
(
Math
.
random
()
*
Death_Factors
.
length
)];
//사망요인 하나를 렌덤으로 고른다.
info
.
death_factor
=
Death_Factors
[
Math
.
floor
(
Math
.
random
()
*
Death_Factors
.
length
)];
//사망요인 하나를 렌덤으로 고른다.
//이벤트 기반으로 일정 시간 간격으로 클라이언트에게 보낼 정보
...
...
routes/index.js
View file @
ab48f5b
...
...
@@ -12,7 +12,7 @@ router.post('/forecasting' , (req,res) =>{
res
.
redirect
(
`/Fname/
${
req
.
body
.
name
}
/Fbirth/
${
req
.
body
.
birth
}
`
);
})
router
.
get
(
'/Fname/:
Fname/Fbirth/:F
birth'
,(
req
,
res
)
=>
{
router
.
get
(
'/Fname/:
name/Fbirth/:
birth'
,(
req
,
res
)
=>
{
// 렌더링 변수
var
time
=
new
Array
();
// 타임스탬프
...
...
@@ -73,7 +73,7 @@ router.get('/Fname/:Fname/Fbirth/:Fbirth',(req,res)=>{
});
}
)
router
.
get
(
'/Cname/:
Cname/Cbirth/:C
birth'
,
(
req
,
res
)
=>
{
router
.
get
(
'/Cname/:
name/Cbirth/:
birth'
,
(
req
,
res
)
=>
{
// 렌더링 변수
var
time
=
new
Array
();
// 타임스탬프
...
...
Please
register
or
login
to post a comment