.


:




:

































 

 

 

 





Harvest , .


, , , . . : -, , . , .

. , , , . , . , .

8.2.4.

, . , . , , , .

, . , (), , . , , .

.

8.2.5.

. :


(, ), (Bin), Main, . , . , ( , ).

, . -, , . -, ( ) . , , . .

, . . . - , , , . [05] " ?". , , . , , , , . , . , - .

. (Mover)

Harvest , . , ' , . (, ) . , . . , , - , () , .


, , . , . .

. , , . , . . , . , , . .

, . Mover

"

". Mover , , . .

Mover . velocity (XInitial YInitial), onArrival Java (, ), . , () . (. . ), , ( ). . onArrival.

, , . , , . . , , .

Mover . vx vy. ,


, . Angle . .

xnow, ynow, stop . , , , . .

xnow :

lf(timer.isActive())

return X - timer.getRest () * Vx; return X;

, - . getRest , . , Vx , xnow . , , , . ynow .

stop , , :

i£(timer.isActive()) { X = xnow(); Y = ynow(); timer.reset();

, , . , , (-) .

jumpto(x, ) (, ):,

stop(); X = ; Y = ;

, . moveto(x, )

(, ). stop();


double dx = x - X;

double dy = - Y;

X = x;

Y = y;

double dist = sqrt(dx*dx + dy*dy);

if(dist == 0) {

onArrival();

return; }

Vx = Velocity * dx / dist; Vy = Velocity * dy / dist; Angle = atan2(Vx, -Vy); double dt = dx!= 0? dx/Vx: dy/Vy; timer.restart(dt);

, . x y , , . , 0, , onArrival. Angle , .

, Mover , , Mover.

Stock ()

, . , . , , . , , : , , -, .

. stock , Mover, ( ) ( , ) ( , )


. , ( ) , , .

. , , . stock : in out ( ), v, . capacity, inFlow, outFlow , . in>out, capacity, , . in<out, 0, . , [0, capacity]. , - . vinitial , onFuii onEmpty code , - .

, , - , , - . vnow - . setv , /, . , - stock .

/ , set_capacity, set_inFlow set_OutFlow. onChange_Capacity, onChange_InFlow onChange_outFlow (. . 7.7). - stock. onchange, .

stock .

Truck ()

. . -


(. 8.4), . , . , . , .

. 8.5 Truck. (velocity), (capacity), , (unloadingRate) , , (parking) (Bin). , shapeBase AnyLogic. getx getY , .

Truck movecontrol, , main, - Truck. , /, Mover ( mover) stock ( stock). mover . 8.6.

, mover,

, , ,

. mover

:

moveControl.fireEvent("ARRIVED");

. . , ,

"ARRIVED".

(. animation ). -


, 90 .

Anglelnitial.



stock, Truck, /. stock . , -, "full" "empty".


. , , move stock. , .

, , . 8.7. , , .

" START_LOADING" "FINISH_LOADING", KOTO TpaKTOpOM.

. : "go_to_bin", , "full", stock . .

. GoingToBin moveto() mover. Truck, . Bin, Truck. , GoingToBin unloading , , , mover "arrived". > . Angle mover -/2. Unloading

: . unloadingRate bin bin , : stock.set_OutFlow(UnioadingRate); main.bin.set_InFlow(UnioadingRate);

onChange_outFlow() onChange_inFlow () , . "empty", bin, "go_to_field", . inFlow outFlow 0, . . : stock.set_OutFlow(0); main.bin.set_InFlow(0);


Cart ()

cart , Truck. Mover stock, main, (Main), . cart "" (. 8.8).

, . "go_to_combain",

. GoingToCombaine ߭ , 40 :

double = main.combine.mover.xnow() - 40; double = main.combine.mover.ynow(); mover.moveto(x, );


, . , . , GoingToCombaine , . GoingToCombaine . , .

. .

AnyLogic ( ). , . . , xnow ynow , . (, ). , , vnow.

Main 3x3. , , . X :

double Xunits[] = new double[2000]; double YunitsU = new double[2000];

:

for(int i=0; i<Xunits.length; i++) {

Xunits[i] = uniform! animation.field.getWidth() - 2);

Yunitsfi] = uniform(animation.field.getHeight() - 2); }

(pivot)


, , . , . - , "" , .

, Java AnyLogic .


III





:


: 2018-10-15; !; : 332 |


:

:

, ; , .
==> ...

1007 - | 823 -


© 2015-2024 lektsii.org - -

: 0.059 .