Skip to content

Commit

Permalink
条件更新他調整
Browse files Browse the repository at this point in the history
  • Loading branch information
X-20A committed Dec 12, 2024
1 parent f308aec commit 6462c20
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 43 deletions.
43 changes: 21 additions & 22 deletions analysis/7-5-D/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ $(function() {
startProcess();
}

function displayInfo(e_count, e_length, c_length, first, last) {
function displayInfo(e_length, c_length, first, last) {
$('#info-container').css('display', 'block');
$('#wait-message').css('display', 'none');
$('#node').text(`node : ${node}`);
$('#total').text(`Total sortie : ${e_count}`);
$('#total').text(`Total sortie : ${e_length}`);
$('#date-span').text(`${convertDateTime(first)}${convertDateTime(last)}`);
let color = 'red';
if(!c_length) {
if (!c_length) {
color = '#4ae325';
}
$('#count').html(`<span style="color:${color};">${c_length}</span> / ${e_length}`);
Expand All @@ -64,17 +64,16 @@ $(function() {
let ces = await startSim(sortie_data, map_info);
//反例を表示
let c_length = ces.length;
if(c_length) {
if (c_length) {
let unmatch = openList(entries, ces, 40, true);
$('#counterexample-list').append(unmatch);
let matchList = excludeElements(e_length, ces.map(subArray => subArray[0]));
let match = openList(entries, matchList, 10, false);
$('#match-list').append(match);
}
let entry_count = sortie_data.result.entryCount;
let last = entries[0].datetime;
let first = entries[e_length - 1].datetime;
displayInfo(entry_count, e_length, c_length, first, last);
displayInfo(e_length, c_length, first, last);
}

function openList(entries, list, max, isCe) {
Expand All @@ -83,15 +82,15 @@ $(function() {
for (let i = 0; i < list.length && iterations < max; i++) {
html += '<div class="list-item">';
let fleet = null;
if(isCe) {
if (isCe) {
fleet = entries[list[i][0]];
} else {
fleet = entries[list[i]];
}
let f1_length = fleet.fleet1.length;
let f2_length = fleet.fleet2.length;
let fleet1 = fleet.fleet1data;
let fleet2 = fleet.fleet2data;
let fleet1 = fleet.fleet1;
let fleet2 = fleet.fleet2;
let f1_names = [];
let f2_names = [];
for (var q = 0; q < f1_length; q++) {
Expand All @@ -100,27 +99,27 @@ $(function() {
for (var q = 0; q < f2_length; q++) {
f2_names.push(fleet2[q].name);
}
if(isCe) {
if (isCe) {
html += createRouteHtml(list[i][1], getRoute(fleet));
} else {
html += createRouteHtml(null, getRoute(fleet));
}
html += `<p>${getFleetType(fleet)} | ${getFleetSpeed(fleet)}</p>`;
let los = getLos(fleet);
for(let i = 0;i < 4;i++) {
html += `<span style="font-weight:600;">${i+ 1}</span><span>:${los[i]} </span>`;
for (let i = 0; i < 4; i++) {
html += `<span style="font-weight:600;">${i + 1}</span><span>:${los[i]} </span>`;
}
if(fleet.radars) {
if (fleet.radars) {
html += `<p>radars:${fleet.radars} | radarShips:${fleet.radarShips} | radars5los:${fleet.radars5los} | radarShips5los:${fleet.radarShips5los}</p>`;
} else {
html += `<p>radars:0 | radarShips:0 | radars5los:0 | radarShips5los:0</p>`;
}
html += createListHtml(f1_names);
if(f2_length) {
if (f2_length) {
html += createListHtml(f2_names);
}
html += getShipTypes(fleet, 1);
if(f2_length) {
if (f2_length) {
html += getShipTypes(fleet, 2);
}
html += '</div><hr>';
Expand All @@ -134,17 +133,17 @@ $(function() {
db_route = cutOffCheckPoint(db_route);
db_route = cutOffEndPoints(db_route);
let res = '';
if(sim_route) {
if (sim_route) {
res += `<p>sim : ${sim_route} | db : ${db_route}</p>`;
} else {
res += `<p>db : ${db_route}</p>`;
res += `<p>db : ${db_route}</p>`;
}

return res;
}
function createListHtml(names) {
let res = '<p>';
for(name of names) {
for (name of names) {
res += name + ' ';
}
res += '</p>';
Expand All @@ -153,14 +152,14 @@ $(function() {
function getShipTypes(fleet, num) {
let res = '<p>';
let types = null;
if(num === 1) {
if (num === 1) {
types = fleet.fleetOneTypes;
} else {
types = fleet.fleetTwoTypes;
}
let elem = [];
for(type of types) {
switch(type) {
for (type of types) {
switch (type) {
case 1:
elem.push('DE');
break;
Expand Down Expand Up @@ -223,7 +222,7 @@ $(function() {
break;
}
}
for(type of elem) {
for (type of elem) {
res += `<span class="types">${type}</span>`;
}
res += '</p>';
Expand Down
42 changes: 21 additions & 21 deletions analysis/7-5-D/manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,45 +52,45 @@ let end_points = ['F']; //List of the end points that can be reached
function branch(node) {
switch(node) {
case null:
if(f_speed === '最速艦隊') {
if (f_speed === '最速艦隊') {
return 'F';
}
if(CV + CVB >= 2) {
if (CV + CVB >= 2) {
return ['E', 'F'];
}
if(CVL >= 3) {
if (CVL >= 3) {
return ['E', 'F'];
}
if(BBs + CAs >= 3) {
if (BBs + CAs >= 3) {
return ['E', 'F'];
}
if(CL + DD === 0) {
if (BBs + CV + CVB + CAs >= 3) {
return ['E', 'F'];
}
if(f_speed === '高速+艦隊') {
return 'F';
}
if(BBs + CV + CVB + CAs >= 3) {
if (CL + DD === 0) {
return ['E', 'F'];
}
if(DD + DE >= 3) {
if (f_speed === '高速+艦隊') {
return 'F';
}
if (DD + DE >= 3) {
return 'F';
}
if(BBs <= 1) {
if (BBs <= 1) {
return 'F';
}
if(DD + DE <= 1) {
if (DD + DE <= 1) {
return ['E', 'F'];
}
if(BBs + CVL >= 3) {
if(f_speed !== '低速艦隊') {
return 'F';
} else {
return ['E', 'F'];
}
} else {
if (f_speed === '低速艦隊') {
return ['E', 'F'];
}
if (BBs + CVL >= 3) {
return 'F';
}

return 'F';

break;
}
}
Expand Down Expand Up @@ -154,8 +154,8 @@ function setData(fleet) {
f1_length = fleet.fleet1.length;
f2_length = fleet.fleet2.length;
f_length = f1_length + f2_length;
let fleet1 = fleet.fleet1data;
let fleet2 = fleet.fleet2data;
let fleet1 = fleet.fleet1;
let fleet2 = fleet.fleet2;
for(var i = 0;i < f1_length;i++) {
f1_names.push(fleet1[i].name);
}
Expand Down

0 comments on commit 6462c20

Please sign in to comment.