设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14895|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" u% j1 l* D4 w! B

, X$ v4 R; m. [2 a% _& b5 Y8 H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ X: Y2 K% k5 ?2 e6 ^/ n2 z3 Y% P$ M9 X$ ]6 V  r8 {; `
begin P_read arriving
3 X3 b3 f0 b. o2 P! b7 o2 P4 K    while 1=1 do begin6 r' s" ?; H, q) `3 _; P* q' [
        read A_tote from "data.txt" with delimiter "\n"$ [" A0 h" h) m) _
        read A_time from "data.txt" with delimiter "\n"
0 S6 l# Y) h6 K5 K  @5 K& l        read A_leave from "data.txt" with delimiter "\n"
" V- h3 G$ n4 U" A" R        read A_picks from "data.txt" with delimiter "\n"
/ e7 n# B, H& Q/ e        set load type to A_tote& f* E% [" m$ N- _
        if A_tote="tote 1" then set A_induct to 1
( U$ S9 m6 K+ P  W        else if A_tote="tote 2" then set A_induct to 2" c! k1 O2 z. X/ B" q
            else set A_induct to 3   
/ o& q7 d' E: I* K: v        set A_i to 0
2 m7 Y8 V, I: T' X0 O. q2 v        clone 1 load to P_induction  C9 u1 S* @: [" j( L
        wait for A_time sec
" A* }/ {6 u( }  ~4 ^* x$ I    end
, q2 t/ ~& u2 p$ E2 mend
) a/ ~0 O$ M* Y) Y. _
) V1 v4 a* i6 Nbegin P_induction arriving! Y3 |+ w, D# {
    if A_induct=1 then clone 1 load to P_pick1. w9 f, y0 G9 j  L0 V
    else if A_induct=2 then clone 1 load to P_pick2
8 H/ h7 r) I) @- z( N, f4 ]- T        else clone 1 load to P_pick3
8 E$ }) r# b2 s6 a* Eend( l6 M$ @4 g2 x1 p
( l4 j/ d# |9 k6 {8 O: [
begin P_pick1 arriving
1 P0 t9 n5 a1 C, M( a2 N, A" U    set A_i to 1, n- a4 Q0 b/ ]
    move into Q_induct15 B( C% y$ W- |+ S% z9 Y1 Y- }
    move into pickaisle.induct1
7 x  r# K$ X0 A/ o    while A_i<=30 do begin
' K7 E- r6 C; g2 Q8 |# P        travel to pickaisle.con(A_i)
$ @, w1 u. M4 m5 I9 D* }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, F) n; n+ R5 J3 o3 ^$ ~        else wait for 10 sec) Y* n" Z& }2 F' B, R
        if A_i=A_leave then send to die8 B* T7 w/ t+ V2 Y9 A: I# Z
        else inc A_i by 1) @" ]( o. @, z+ a; }4 [( b1 j
    end
) Z9 S3 y1 i" w' d8 j2 tend
  U! s, \, }! s1 w
% t# a: n. P7 p; Bbegin P_pick2 arriving3 j  g0 W( U. X2 y" X. B
    set A_i to 11
" z5 D" r9 m" i! @    move into Q_induct25 U+ {2 I8 l2 c+ q8 t$ C8 w% \
    move into pickaisle.induct2. F1 E" o! A/ H
    while A_i<=30 do begin4 W" ~) y0 g- V* l
        travel to pickaisle.con(A_i)
* L% c$ ?: A7 w" N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 }% Q+ U( n* R* x8 t) a
        else wait for 10 sec
9 D) o1 ^5 s# x, V  U        if A_i=A_leave then send to die
4 G# ~  X) y3 v7 X. x9 k* }- x        else inc A_i by 1
% M5 ]* h: z; l9 ]# l6 I    end4 q1 i, ?' V9 @( O
end  w, y* M9 f: ]9 V0 S5 D& O& F

9 Q6 c; t3 A1 z. y: s  |( F1 ubegin P_pick3 arriving
* u4 W6 h7 j3 \- \$ }    set A_i to 21
1 q, T+ ?1 ~/ i+ k    move into Q_induct3# J, m; y- f7 R( w, c
    move into pickaisle.induct3* z8 b* I0 j. T6 V( p
    while A_i<=30 do begin( G6 _7 D0 [/ A1 J1 D
        travel to pickaisle.con(A_i)
4 N4 k: ^0 ]! ^6 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# `7 C! P' L; ~
        else wait for 10 sec$ `) }' J" A* {4 ?# w6 N$ j5 ~5 d) ?
        if A_i=A_leave then send to die
% ]* f  ~" w2 _+ G0 w        else inc A_i by 1
. R; H/ p5 f( {5 Z    end) U7 _% G* T' \1 c
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是个什么东东?' [: G7 ], r$ u2 V0 j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 ]+ O1 R" ^0 p4 T# t
# @/ l+ `6 L" p; d/ u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! C" S# b6 h1 j! l

6 @' F4 M6 S1 F$ s0 G另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ v; L9 \( @4 R/ \) L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  ]2 x7 @' h; f0 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( {3 @4 K2 {% v' Y0 {5 Z7 F- C
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 K  x, ~& [3 L/ H4 I2 D6 X+ V, `7 Z
begin P_induction arriving
% ?" R2 E6 k6 \    clone 1 load to P_pick(A_induct)! U' o. C5 f/ ~3 }1 d( X4 _1 }4 @
end最大的系" K0 G; a5 k! C7 l, J1 p

: d0 p3 w; R% W: rbegin P_pick arriving
! |6 `4 n% u% Y0 k' P    set A_i to procindex * 10 + 1
: I. T( a1 K" ^0 c; e1 u: {1 G    move into Q_induct(procindex), W$ y4 `5 P8 r) s2 v8 I9 c2 e
    move into pickaisle.induct(procindex)1 B6 j! S: b6 k& F
    /*check the type of pickaisle.induct(i), for your last problem.*/$ u9 r) W4 z! v  l- \
" }3 x: M' X$ H2 o9 e- e
    while A_i<=30 do begin' }. K$ K3 t# t5 E6 u0 ~
        travel to pickaisle.con(A_i)
: Z! c0 R5 f& H: ?) Z, b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ^& D1 `; I6 O9 ^, H0 S# Z& c        else wait for 10 sec3 |- K  Q( V6 \# O4 R
        if A_i=A_leave then send to die8 W' P. g$ @6 |, ]* Z! G; J6 x
        else inc A_i by 1$ F# V/ H1 [3 U1 l3 c- X& b! V
    end& A( P0 z; y" P" Y6 y2 q& C% a5 t
end5 P( M  \. P$ r& ?- o6 U
0 }0 O7 J( P$ c. q
其中的procindex为整形,代表当前process的序号。
9 U$ V9 R7 j, k1 @! g- x3 o) zstation和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-30 00:28 , Processed in 0.014178 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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