设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12633|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: V: a& G$ _, L6 M
, C# {! q: H  S+ 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中的数值,不知道会不会有什么不妥。# W- v) \8 d3 ]

6 Y) a: _9 h* h+ X  z+ t" qbegin P_read arriving
/ v, H: ~2 o5 ~    while 1=1 do begin7 z& y9 F& H* j0 B  e
        read A_tote from "data.txt" with delimiter "\n"
* B3 i8 V, g3 ]# z5 Q        read A_time from "data.txt" with delimiter "\n"
. ~6 Z: I5 @' W0 L9 M5 f        read A_leave from "data.txt" with delimiter "\n"6 u' p5 q# G6 C9 O
        read A_picks from "data.txt" with delimiter "\n"
+ Y* o' k7 I- f" C3 f; M        set load type to A_tote! {: y7 Z8 a* m( X5 ?5 H2 {
        if A_tote="tote 1" then set A_induct to 10 P2 c+ o6 T* C/ I8 R
        else if A_tote="tote 2" then set A_induct to 2
# }  \4 t2 n! F" ^: x" q            else set A_induct to 3   
+ E  W$ N' K- Q7 v% a0 b        set A_i to 0/ K" r# |9 Y( o4 i8 F% k
        clone 1 load to P_induction% H$ }. ]4 V9 T/ g* `& Q; i# C
        wait for A_time sec
. r7 d8 {. b0 A    end
, M: {# _6 W+ `' z9 P$ tend
* M, A& m, F8 P
3 P+ j- M& \' c2 J* Zbegin P_induction arriving
) L5 e1 @) S6 p    if A_induct=1 then clone 1 load to P_pick1
2 c7 o* H) h& X/ f$ V% O( V4 s9 V    else if A_induct=2 then clone 1 load to P_pick2# B9 u) @) ]- y9 w- C* C9 S
        else clone 1 load to P_pick3, K1 S# l7 y: X! w# i
end
6 J. n9 H2 }) G
& u# c- `) T0 g) J( |2 a, Sbegin P_pick1 arriving( {( p3 I$ {/ D% k" U
    set A_i to 1* U$ o( K1 O; T  P5 P1 d
    move into Q_induct15 p+ v+ ?$ W! r1 v
    move into pickaisle.induct1
" u6 ~0 p% x/ Z1 M1 p    while A_i<=30 do begin
5 u8 E4 B- Z1 f3 H' w, ~8 p4 u        travel to pickaisle.con(A_i)
/ n% H/ N, p6 E$ N* d, Q- {4 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 y1 \/ B& b* }8 p- x
        else wait for 10 sec
0 @6 z* l) Q3 y0 w5 s9 K2 T        if A_i=A_leave then send to die, @) j# X" a$ `3 m) G0 t+ V1 V6 T" d
        else inc A_i by 1' ]" [/ Y6 F/ ]' c
    end
$ C% j' C. F  tend
2 E. S8 V4 @, O* |
: N- `, ~* D& v/ m# Ubegin P_pick2 arriving  J( Z) O: [+ ]0 g7 o
    set A_i to 11* r7 V8 J4 s6 O  H6 K6 E
    move into Q_induct2
$ {, e3 R* e2 [# B- a    move into pickaisle.induct2, P( \/ `# g8 M- u5 P
    while A_i<=30 do begin
( M3 y! v; M- T0 z8 j  x8 ?        travel to pickaisle.con(A_i)1 I3 N$ [$ i7 K/ [" R0 I, u- B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 t: Y% G6 k! h+ o& |( W        else wait for 10 sec
* {, I; x/ Y& W/ W        if A_i=A_leave then send to die$ Q/ U; E: l# b5 U: z3 Q3 \8 Y9 \
        else inc A_i by 1
: P4 Z& W* d7 z2 z    end- f% d% Z( n# \; g) E2 M
end
: N6 }4 J) c3 H" r5 a2 _
: H$ y7 G: a2 [! i, J9 ?begin P_pick3 arriving
  E6 C  w9 H" r) |: A) u    set A_i to 21  V2 n( D: O2 G8 \
    move into Q_induct3
  |  _% w1 T- K, W# {4 U( M5 i* k    move into pickaisle.induct3
2 V. A( Z1 D8 @' E5 k    while A_i<=30 do begin
9 g# J& w( Z+ F' S4 f4 E        travel to pickaisle.con(A_i)  p* c. C3 \/ [5 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Y" @* ]7 p" G$ N3 I# X        else wait for 10 sec
# U" m! b( m# X5 N) g$ b  W        if A_i=A_leave then send to die2 k( h' j/ g! r& b! A4 }% @
        else inc A_i by 1
, f/ t9 m+ q# ]1 u/ `* D+ v& a    end
& q# h. N6 g, I$ Dend

最佳答案

查看完整内容

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是个什么东东?
6 R) U/ K" Y6 H8 S- O" wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 y/ J) R) j# L
* ~3 W  w& d$ C0 |) N6 `/ F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: W3 u! b- v, i4 N4 T  F5 @. F4 [$ ?  I5 b9 x# }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! `1 }# l7 o1 i; O  w# s/ [% D, P: Q* @
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  P- X/ |' n. y& Z6 [! F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 z7 U3 g/ |- X" W5 e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ @% A1 J* I4 e' a4 r9 }
begin P_induction arriving
  K1 a; E3 B. c- n    clone 1 load to P_pick(A_induct)& @+ M& \+ {, \* }. o
end最大的系( L# l2 I7 `0 S# D: H/ e  K* I

2 s' ?; T6 G1 J" d. g7 W* n4 wbegin P_pick arriving
. L7 ^  z" o5 R( n    set A_i to procindex * 10 + 19 m: f; g$ [2 w7 }0 e/ j
    move into Q_induct(procindex)% J$ Q7 n: C& ?+ \7 G& D4 k
    move into pickaisle.induct(procindex)
* |0 i  P# |9 Q2 ^    /*check the type of pickaisle.induct(i), for your last problem.*/5 P, N3 A& {" u/ {( f5 B

) y* Q0 p+ g9 O7 o. H( a    while A_i<=30 do begin) q+ m5 [1 a% U3 X
        travel to pickaisle.con(A_i)
' V  y) }5 G" f) }! t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 }, e$ b& R# m1 P) A! ~" e4 U
        else wait for 10 sec! E. u0 I7 D# ~- i( b# s
        if A_i=A_leave then send to die  n: R- j0 \7 A# \. t/ A
        else inc A_i by 1
8 i; W6 V0 ]# v0 }" \/ M    end; a4 X! Z" I% K% r. V: D. R8 j
end
( F" b5 d: Q" ~. a1 t7 p9 s1 u" q/ s5 i9 v- r- A0 J% Y" I
其中的procindex为整形,代表当前process的序号。, ~8 A( v; t, }5 _% I
station和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-2-6 07:01 , Processed in 0.022579 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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