设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14290|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. s. `( Y: C( n" \. w% ]4 R  P* _  Q+ T, M6 h5 u: Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 P1 {% ]1 w& Z" o6 k" o
6 K* E* m/ V: e' T' P; kbegin P_read arriving! y5 |2 Q2 Q5 j/ C7 A
    while 1=1 do begin& U3 @/ G8 P, ^* l! a
        read A_tote from "data.txt" with delimiter "\n"
& \6 u4 V% N2 L* {( `        read A_time from "data.txt" with delimiter "\n"
9 Z* f* ?6 t8 Y8 y& O        read A_leave from "data.txt" with delimiter "\n". Z7 o4 @/ j& ?
        read A_picks from "data.txt" with delimiter "\n"8 z5 m3 ]- j/ d, M* W2 I, C7 F
        set load type to A_tote8 V9 m: Z# g8 X* h1 {6 f
        if A_tote="tote 1" then set A_induct to 1  Y# h! b9 ?, m0 H: f2 [+ }8 p
        else if A_tote="tote 2" then set A_induct to 2
+ |2 t  a! N% G2 H- N# ]2 f            else set A_induct to 3   
! _5 L5 T" }6 M1 k7 `& l( v1 j        set A_i to 0, D' q, a- Q7 y- C0 k
        clone 1 load to P_induction
% n7 G, m9 s/ R8 S* Z+ K: s4 c5 L        wait for A_time sec: \, c$ G7 M  b* d# O! Q
    end
1 G  J+ M$ `; z' \. R% r) d- ?; d# jend- V2 \, _. t* Y- K" t7 w# X! M
: M8 ]0 H" @. B: x# Q; ^  `  \
begin P_induction arriving
7 f# L% G9 I6 M7 y. M* G! r    if A_induct=1 then clone 1 load to P_pick1
# p  c* j. c; U$ M  D    else if A_induct=2 then clone 1 load to P_pick21 s% G; I0 a! K1 {
        else clone 1 load to P_pick3  C& g& r% s9 P- ?
end
$ f4 o7 J9 W' J! M' B' ?3 P8 Y$ G) U3 u0 t7 t
begin P_pick1 arriving
& }% g1 R8 L" X2 i! t; K3 g    set A_i to 1
5 C* ~1 L( e; E3 U* z+ P& }    move into Q_induct1
" }; @7 }0 a3 E' ^/ B/ C* `    move into pickaisle.induct13 c  ]# t2 ~) D$ j4 e% e0 x& B8 e( I
    while A_i<=30 do begin7 r7 X5 h% O7 Q; ~& e  _- A
        travel to pickaisle.con(A_i)& }" |1 ]; e- z5 r! a0 t' G% X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 F0 C; h- S0 p' z) i
        else wait for 10 sec
; I; \0 g& W: u2 y3 i        if A_i=A_leave then send to die7 i0 v8 N( a: b/ O; S# z, i
        else inc A_i by 1
' g% [" Z$ E6 w0 o" k    end, \6 G( d" X+ V! j1 s+ g  u
end
; P3 O: N7 j3 j$ r6 e* E% J4 T# e1 r$ g& q
begin P_pick2 arriving5 U3 I3 Z7 z) c7 W
    set A_i to 111 Y+ R4 k: q$ n  W
    move into Q_induct2
2 N. @" ?+ v( S) L0 u$ x# U& U, c    move into pickaisle.induct2) o- P7 L& c+ y& D9 e; G2 H- ^
    while A_i<=30 do begin
- ]+ P7 s/ v1 D9 I        travel to pickaisle.con(A_i)1 h% N" N- O" ~, R3 t7 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 ^+ g7 z' K, p8 ]2 a7 N1 [$ }
        else wait for 10 sec
! h0 ~6 V7 R* @- Z6 q7 E        if A_i=A_leave then send to die
5 f! ]7 P; C. b/ J8 e6 G3 ?, Q& \        else inc A_i by 17 y6 s% \* w7 d6 @6 ^
    end+ X$ n+ G8 \) [0 L# h0 P
end7 E: y- s0 ^4 M. E8 w  g
. \# P/ I# n" i; Y0 }3 X0 E
begin P_pick3 arriving
! y; [& b+ z9 W) A    set A_i to 21
* N9 }6 i5 }2 O1 J4 c# W7 {, I    move into Q_induct3! q6 ]% ]3 i9 h/ N* |7 U! d. m
    move into pickaisle.induct3' o5 X' l" d& W1 D
    while A_i<=30 do begin
, F" l' m6 A$ z) L        travel to pickaisle.con(A_i)
7 i# O6 t  o9 u% E0 X  V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ V" B$ P3 x. P5 y+ H( v        else wait for 10 sec1 ^& _, S; v' W$ m# `# @
        if A_i=A_leave then send to die- d2 w7 D/ q+ y2 b$ T0 ]
        else inc A_i by 12 _: K+ ^; I: e% W' u5 T4 F+ Y! O
    end
  n. \! t! G3 s- yend

最佳答案

查看完整内容

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是个什么东东?. n. }3 K# @4 d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 I2 P. H: P! H3 d1 J% o
* @' B$ q- ?; ^3 t4 V/ ]: J1 s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ p% L& P3 X: c7 \, X3 P( v  t' ^
8 x* E7 J, |0 J6 @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. @; f6 J* f8 o9 t4 ~1 A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# e% _8 E8 |* n/ U5 J# F5 {1 B9 `2 W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 s+ A2 ]& k9 T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, R% n3 b) C! e9 c4 u) O) I! t% \
begin P_induction arriving
; Y' }. P. o" Q    clone 1 load to P_pick(A_induct)# {$ P. @' q) _' d' S3 P
end最大的系
" V7 ^! x: H9 C# s4 i
# w: e9 N$ q, j3 D, X$ s: @begin P_pick arriving
4 y: B# l# Z! @( T    set A_i to procindex * 10 + 14 Q8 B5 z  A' F1 i; {% J: X" X
    move into Q_induct(procindex)# D" i! w) O& {/ I3 g% `+ v0 ~7 h) @
    move into pickaisle.induct(procindex)
0 c) r! P8 y- `, A" w    /*check the type of pickaisle.induct(i), for your last problem.*/+ b7 Y1 ^9 J- l. n7 T  s( M

( x9 W5 h0 p- [8 r6 |8 a- V    while A_i<=30 do begin- {- e5 g% e# `8 [0 d2 q
        travel to pickaisle.con(A_i)  T& D& P4 l- ]' P7 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 |5 q: N) Z* K1 M) R! N
        else wait for 10 sec
$ f* a" ?' ?% d4 c2 q        if A_i=A_leave then send to die
7 A( g$ j" [) l        else inc A_i by 1
8 |, h% {' Z2 T8 _+ J    end3 ?0 I* L  G  h6 t7 D$ [1 e7 |; p
end
4 C3 }7 w- K+ F$ V; D' T
: ~# _% e0 H9 r6 z其中的procindex为整形,代表当前process的序号。
4 H6 P/ h( a; D* t9 e) Z. rstation和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-6-28 13:00 , Processed in 0.015227 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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