version 1.8, 2000/07/28 21:36:13
|
version 1.11, 2000/08/19 19:47:30
|
Line 9 Resource Assembly Tool
|
Line 9 Resource Assembly Tool
|
1/7,1/8,1/10,1/14,1/15,1/16,1/21,1/22,1/29,1/30,1/31, |
1/7,1/8,1/10,1/14,1/15,1/16,1/21,1/22,1/29,1/30,1/31, |
2/2,2/3,2/10,2/12,2/13,2/14,2/15,2/17,2/18,2/19,2/20,2/21,2/22, |
2/2,2/3,2/10,2/12,2/13,2/14,2/15,2/17,2/18,2/19,2/20,2/21,2/22, |
5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24,5/25, |
5/2,5/3,5/4,5/5,5/6,5/8,5/9,5/13,5/18,5/20,5/22,5/24,5/25, |
6/7,6/8,6/9,6/10,6/12,6/15,7/4,7/26,7/28 |
6/7,6/8,6/9,6/10,6/12,6/15,7/4,7/26,7/28,7/31,8/5,8/19 |
Gerd Kortemeyer with Scott Harrison |
Gerd Kortemeyer with Scott Harrison |
--> |
--> |
|
|
Line 62 var funny='|';
|
Line 62 var funny='|';
|
var reqaction=''; |
var reqaction=''; |
var canceltim; |
var canceltim; |
|
|
|
var expense=0; |
|
|
var data1=new Array(1024); |
var data1=new Array(1024); |
var data2=new Array(1024); |
var data2=new Array(1024); |
var data3=new Array(1024); |
var data3=new Array(1024); |
Line 75 var inf;
|
Line 77 var inf;
|
function insertrow(j,ex1,ex2) { |
function insertrow(j,ex1,ex2) { |
var kj; |
var kj; |
stored=0; |
stored=0; |
|
expense++; expense++; |
objects1=''; |
objects1=''; |
objects2=''; |
objects2=''; |
for (kj=0;kj<=maxrow;kj++) { |
for (kj=0;kj<=maxrow;kj++) { |
Line 220 function insertcol(j) {
|
Line 223 function insertcol(j) {
|
if ( col[kj]>j ) { col[kj]++; } |
if ( col[kj]>j ) { col[kj]++; } |
} |
} |
maxcol++; |
maxcol++; |
|
expense++; expense++; |
col[maxcol]=j+1; |
col[maxcol]=j+1; |
} |
} |
|
|
Line 343 function comingthru (jid,kid,dkid) {
|
Line 347 function comingthru (jid,kid,dkid) {
|
|
|
function insertport (obj1,d,inout,linkobj) { |
function insertport (obj1,d,inout,linkobj) { |
|
|
|
|
var k; var port; var revport; |
var k; var port; var revport; |
stored=0; |
stored=0; |
data1=obj[obj1].split('&'); |
data1=obj[obj1].split('&'); |
Line 422 function insertport (obj1,d,inout,linkob
|
Line 425 function insertport (obj1,d,inout,linkob
|
|
|
function addobj(kjid,objs) { |
function addobj(kjid,objs) { |
stored=0; |
stored=0; |
|
expense++; |
if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } |
if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } |
rowcont[kjid]+=obj.length; |
rowcont[kjid]+=obj.length; |
obj[obj.length]=objs; |
obj[obj.length]=objs; |
Line 481 function delobj(obj1) {
|
Line 485 function delobj(obj1) {
|
} |
} |
} |
} |
} |
} |
|
obj[obj1]=''; |
} |
} |
|
|
// --------------------------------------------------------- Garbage collection |
// --------------------------------------------------------- Garbage collection |
Line 627 function dellink (linknr) {
|
Line 632 function dellink (linknr) {
|
// Links obj1 with obj2, creates new objlink, marks all elements with number |
// Links obj1 with obj2, creates new objlink, marks all elements with number |
|
|
function joinres (obj1,obj2,cond) { |
function joinres (obj1,obj2,cond) { |
var k; var kr; var outcol; var incol; var d; |
|
stored=0; |
stored=0; |
|
var minexpense; |
|
var best; |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,1,1); |
|
minexpense=expense; |
|
best=0; |
|
finishload(); |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,1,-1); |
|
if (expense<minexpense) { |
|
best=1; |
|
minexpense=expense; |
|
} |
|
finishload(); |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,-1,1); |
|
if (expense<minexpense) { |
|
best=2; |
|
minexpense=expense; |
|
} |
|
finishload(); |
|
|
|
expense=0; |
|
tryjoin(obj1,obj2,cond,-1,-1); |
|
if (expense<minexpense) { |
|
best=3; |
|
minexpense=expense; |
|
} |
|
|
|
|
|
if (best==0) { |
|
finishload(); |
|
tryjoin(obj1,obj2,cond,1,1); |
|
} |
|
if (best==1) { |
|
finishload(); |
|
tryjoin(obj1,obj2,cond,1,-1); |
|
} |
|
if (best==2) { |
|
finishload(); |
|
tryjoin(obj1,obj2,cond,-1,1); |
|
} |
|
|
|
} |
|
|
|
|
|
function tryjoin(obj1,obj2,cond,d1,d2) { |
|
var k; var kr; var outcol; var incol; var d; var dest; |
|
|
dest=objlinks.length; |
dest=objlinks.length; |
objlinks[dest]=obj1+':'+obj2+':'+cond; |
objlinks[dest]=obj1+':'+obj2+':'+cond; |
data3=obj[obj1].split('&'); |
|
sum=0; |
outcol=insertport(obj1,d1,2,dest); |
for (k=2;k<data3.length;k++) { sum+=col[data3[k].split(':')[0]]; } |
|
outmiddle=sum/(data3.length-2); |
|
data3=obj[obj2].split('&'); |
|
sum=0; |
|
for (k=2;k<data3.length;k++) { sum+=col[data3[k].split(':')[0]]; } |
|
inmiddle=sum/(data3.length-2); |
|
d=inmiddle-outmiddle; |
|
outcol=insertport(obj1,d,2,dest); |
|
insertcond(obj1,outcol,cond); |
insertcond(obj1,outcol,cond); |
incol=insertport(obj2,-d,1,dest); |
incol=insertport(obj2,d2,1,dest); |
if (row[inrow]==(row[outrow]+1)) { |
if (row[inrow]==(row[outrow]+1)) { |
insertrow(row[outrow],-1,-1); |
insertrow(row[outrow],-1,-1); |
} |
} |
Line 1695 function graphreset() {
|
Line 1743 function graphreset() {
|
insertcol(-1); |
insertcol(-1); |
|
|
objcont[0]=''; |
objcont[0]=''; |
objcont[1]='Start::false:start:res' |
|
objcont[2]='Finish::false:finish:res'; |
|
objlinks[0]=''; |
objlinks[0]=''; |
objlinks[1]='1:2:0'; |
if (((objcont[1]==undefined)&&(objcont[2]==undefined)) || |
|
((objcont[1]=='')&&(objcont[2]==''))) { |
|
objcont[1]='Start::false:start:res' |
|
objcont[2]='Finish::false:finish:res'; |
|
} |
graphdef='no'; |
graphdef='no'; |
|
|
} |
} |
Line 2118 function graphopt() {
|
Line 2167 function graphopt() {
|
row[k]=k; |
row[k]=k; |
} |
} |
maxrow=rowcont.length-1; |
maxrow=rowcont.length-1; |
|
|
var oldlinks=new Array(); |
var oldlinks=new Array(); |
for (k=0;k<objlinks.length;k++) { oldlinks[k]=objlinks[k]; } |
for (k=0;k<objlinks.length;k++) { |
|
oldlinks[k]=objlinks[k]; |
|
objlinks[k]=''; |
|
} |
objlinks.length=0; |
objlinks.length=0; |
objlinks[0]=''; |
objlinks[0]=''; |
|
graphdef='yes'; |
|
save(); |
|
|
for (k=0;k<objsorted.length;k++) { |
for (k=0;k<objsorted.length;k++) { |
kj=(objsorted[k].split(':'))[0]; |
wheelswitch(); |
|
message("Connecting Resources: "+funny); |
|
kj=(objsorted[k].split(':'))[0]; |
for (ij=1;ij<oldlinks.length;ij++) { |
for (ij=1;ij<oldlinks.length;ij++) { |
if (oldlinks[ij]) { |
if (oldlinks[ij]) { |
data1=oldlinks[ij].split(':'); |
data1=oldlinks[ij].split(':'); |
if (data1[0]==kj) { |
if (data1[0]==kj) { |
joinres(data1[0],data1[1],data1[2]); |
joinres(data1[0],data1[1],data1[2]); |
|
save(); |
} |
} |
} |
} |
} |
} |
} |
} |
graphdef='yes'; |
|
} |
} |
|
|
// ----------------------------------------------------------- Remove e-objects |
// ----------------------------------------------------------- Remove e-objects |
Line 2196 function finishload() {
|
Line 2252 function finishload() {
|
if (data2[0]=='zscale') { zscale=1*data2[1]; } |
if (data2[0]=='zscale') { zscale=1*data2[1]; } |
} |
} |
} |
} |
|
if (graphdef=='yes') { |
|
for (k=1;k<=maxrow;k++) { |
|
if (rowcont[k]==undefined) { rowcont[k]=''; } |
|
} |
|
} |
} |
} |
|
|
// -------------------------------------------------------------- Undo function |
// -------------------------------------------------------------- Undo function |
Line 2352 function leave() {
|
Line 2413 function leave() {
|
if (!inf.closed) { |
if (!inf.closed) { |
inf.close(); |
inf.close(); |
} |
} |
if (stored==0) { |
|
if (confirm('Store changes?')) { |
|
storechange(); |
|
} |
|
} |
|
} |
} |
|
|
</script> |
</script> |