设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14341|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 b9 G0 d, L/ ?/ u4 G* ?/ ], H

: b: S2 A/ G6 q( O3 ?# k. t( x我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。' e. k0 o& `6 t: W9 k% T

& X2 k5 f+ j9 U0 ybegin P_read arriving8 `" e' v3 J3 |7 M
    while 1=1 do begin
. a/ C1 {  f0 l  d/ `! C        read A_tote from "data.txt" with delimiter "\n"
* @, c! T& n6 W        read A_time from "data.txt" with delimiter "\n"
$ S3 }1 e. A3 J% F$ E1 y        read A_leave from "data.txt" with delimiter "\n"
1 p( ^" E  O- D        read A_picks from "data.txt" with delimiter "\n"
  r9 q* E$ b% L- J: I2 c        set load type to A_tote( s8 W( _3 M! y- \' Y
        if A_tote="tote 1" then set A_induct to 1
# v" ?# ~) E/ x' y0 I  g3 Q& W        else if A_tote="tote 2" then set A_induct to 2
, ~3 h) v% D# m' P  {! @# d            else set A_induct to 3    % F$ C  j; w" V3 J* m% \- V3 W
        set A_i to 0+ ~. O# ?% H  o- k
        clone 1 load to P_induction
- b' V! e! _0 A% ]0 ^. C; b8 F        wait for A_time sec' N( l: N5 X7 t
    end
0 R4 O* b" @4 eend4 v: L$ D; r) R( K' h; l
" P- E: K3 i$ f% o) `) R5 G$ g) G8 G
begin P_induction arriving; i1 t; }- M0 s1 u
    if A_induct=1 then clone 1 load to P_pick1" M: `1 W! }& a) o: B7 v
    else if A_induct=2 then clone 1 load to P_pick2# z% x, ~- S% ?) n
        else clone 1 load to P_pick3: A2 V% c$ i8 |1 L. Y6 y, T
end3 X  g1 k6 d  c" N  D1 k
- ]; A+ O& e3 {2 t
begin P_pick1 arriving' d$ G& y; A% U) r  V8 C. G
    set A_i to 1
+ K' u% ?3 R# k! h' _# s2 `    move into Q_induct1" A8 M; z+ l" @) i# B
    move into pickaisle.induct1$ I9 q, c1 }8 h  e4 M3 Z; q
    while A_i<=30 do begin
& C1 R* A$ S. a1 h, f        travel to pickaisle.con(A_i)6 E1 J* F0 o& [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ j& r' \% v/ u+ ?
        else wait for 10 sec
( c* l0 D* J, _& y, t5 B" ]( l; P  L& @        if A_i=A_leave then send to die
" u1 S: K/ E6 W        else inc A_i by 12 E6 W* c% U7 u  |+ f( W
    end
- H" ^& q% t1 s& K; U" @4 P. S( tend
' m6 D- B* G- y6 m8 w. ~: @' M/ X7 R
begin P_pick2 arriving9 N# R( u5 k! O) K9 U9 g
    set A_i to 11
- K; H: w) C, F( u. d- K    move into Q_induct2$ v, {' d$ y  f' [) }4 g1 @
    move into pickaisle.induct2, G1 D: l+ u( r. N5 m2 X2 r- X$ z
    while A_i<=30 do begin# v1 z/ O( H& F
        travel to pickaisle.con(A_i)( H5 S6 [; V' R% O! e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ g! ^2 w0 L1 K  F) D2 a
        else wait for 10 sec- w8 j( z# g- G
        if A_i=A_leave then send to die
5 S. O# q4 Y: Z1 K' J        else inc A_i by 1
& j9 v  v, ~' @" r4 m. [  ~    end
4 I- H: E1 l3 d  I% a0 _end8 u. g4 @1 }( @7 v: D# Y0 `  x

, T4 O5 F% i  j1 @4 b; w6 ?' S; i9 jbegin P_pick3 arriving
& P- `$ P, }7 Y4 w& K    set A_i to 21
9 Q) L. k. X+ q* j9 j8 m    move into Q_induct3( v4 A6 O: A( h; d7 |
    move into pickaisle.induct3- r3 g; K" Y9 v% ^
    while A_i<=30 do begin
8 w0 w. ]0 c/ r7 W$ L2 H        travel to pickaisle.con(A_i)
" s0 f& v1 @' }7 k' W5 X: {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 _6 E$ w" e2 Z5 w; i
        else wait for 10 sec# P5 t$ N8 _/ B) O( O$ F
        if A_i=A_leave then send to die
) ]5 B3 A( q8 N3 f        else inc A_i by 1
% `7 {; y. Y4 s0 `" c% W    end& _& |( z6 K8 D* z& ?0 s3 a
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?8 b$ R4 p' e# t0 W7 D1 }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) f& y+ w& U& c- p; J7 [9 E2 b$ M5 X1 w" q# d0 {  @2 S
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 Y+ W2 [# J! @$ Q  R- \$ J% z1 r9 a" B$ c" R6 z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: L' g0 |" R9 H4 _7 j1 V% |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% E- ^* _; [; u2 ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ M: w" V1 n/ [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& r- T; j3 B8 b2 l
begin P_induction arriving8 D5 x. X5 ?2 ^- X3 X7 A( b, Y
    clone 1 load to P_pick(A_induct)! A: n, N+ ~3 o3 w* R! K
end最大的系
- m( y5 e3 `7 c! S& i- M
  n, o- G3 S9 a* o7 r- _begin P_pick arriving
. _' m1 e+ x! c: ^8 \; i    set A_i to procindex * 10 + 15 y7 O- t8 T. C" H" H
    move into Q_induct(procindex)- n& E0 V6 p* Q$ O1 r: i" G, ~
    move into pickaisle.induct(procindex)
4 ]$ c# `/ D3 d    /*check the type of pickaisle.induct(i), for your last problem.*/- C$ j  A5 Q4 p$ e6 J3 V/ M

6 q; ^! l9 r" ]    while A_i<=30 do begin: D0 M% ?7 J' F1 K# X9 v8 Y
        travel to pickaisle.con(A_i): V& S  c$ J6 _- ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  Y8 l" V$ o1 `' i4 ]        else wait for 10 sec
4 s7 G7 ~! E0 o$ O5 g        if A_i=A_leave then send to die
( t4 f. e8 Q1 F$ Y+ @        else inc A_i by 1
6 {- e% h8 w" l# T# ]2 O    end/ \% k  O- L! A- a" x7 Z
end6 j7 }2 n6 `/ _- r; h' Q, p

9 Q/ j3 u2 m4 m7 w* h, H5 G4 p其中的procindex为整形,代表当前process的序号。
0 r. u  K) x) Ystation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-7-4 22:51 , Processed in 0.016741 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表