设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14362|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, E, C6 J4 ^. N! t  N/ z$ e5 }3 @3 Z2 X7 u, t+ @4 ]) q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' F& F/ X0 a5 f. |' ?( E  L5 R

# K& W9 }8 x  lbegin P_read arriving
: n9 Q- w5 o+ n$ S& L( I    while 1=1 do begin
- R/ W# x, [) x+ ?4 S3 t9 d/ }        read A_tote from "data.txt" with delimiter "\n"( f% H  ]) E( ^0 n) \) `
        read A_time from "data.txt" with delimiter "\n"- Q- I! U. ?& v/ z, X8 b- b$ a
        read A_leave from "data.txt" with delimiter "\n". z# N8 |+ C( T# c# g
        read A_picks from "data.txt" with delimiter "\n"- N. H6 z) @$ e
        set load type to A_tote. X  ^3 B- b4 s
        if A_tote="tote 1" then set A_induct to 1; C4 ?$ M: T6 {% e" K) x
        else if A_tote="tote 2" then set A_induct to 2
8 K. u' J- R# v0 r            else set A_induct to 3   
3 `4 L% ~0 `5 T8 Z3 D        set A_i to 0
+ y7 R+ c3 F9 l- @8 a        clone 1 load to P_induction
3 o4 `1 h6 K+ D9 ?1 I2 `        wait for A_time sec
+ k& ?5 h2 C. C- C5 G/ {6 h    end
. B' g0 ]+ P9 ]end
& B& x7 f% Z1 G0 Z* y; `3 h, }
: |& S5 T! A. H1 D( ?begin P_induction arriving% t# ?1 K: W7 S
    if A_induct=1 then clone 1 load to P_pick1
7 a! K# r1 I) M5 P' _* b* }    else if A_induct=2 then clone 1 load to P_pick25 B' \) h& z' T; H/ Z3 w
        else clone 1 load to P_pick3
+ T9 h% \, ~2 v8 q% Qend: J: Z8 s/ N1 Z" u
( e0 i! `" M" ^8 o9 ?
begin P_pick1 arriving
& Z; g! N8 }! z- }    set A_i to 1
* {. q8 R1 @0 K, R2 v- b    move into Q_induct1
1 R( R0 T( @9 j) h    move into pickaisle.induct1+ g6 A$ s8 y7 ?8 ^. Q- y
    while A_i<=30 do begin
. R& f% K- u; v6 o        travel to pickaisle.con(A_i)* r- g0 v  p0 l+ f3 X# l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 e9 h+ v) ]$ ]# b
        else wait for 10 sec
0 m+ z" @% ]4 E+ ]0 I        if A_i=A_leave then send to die
. A) i4 h' f& f, h1 _2 P: L+ Z% F        else inc A_i by 11 A. W5 w4 A! W) ~4 O' m
    end( M5 a( j2 M% K* t  X* b
end/ E7 _8 s0 N1 V% ^# Z/ U" @

* X6 @' W; ]+ g; Y5 I5 x! H# G- C4 e4 ybegin P_pick2 arriving: V" F9 c& u/ g
    set A_i to 11, }. N% Q8 r; V/ B
    move into Q_induct2/ g4 S! q  i) F+ ?
    move into pickaisle.induct2/ {- Y8 o! B. s* I$ S$ R# f' E' t
    while A_i<=30 do begin+ j+ h) |6 G* a% i8 q, j9 V. F
        travel to pickaisle.con(A_i)& ]+ P; s/ g& k3 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# n9 B$ ?; ?# i- r. x; t) v3 f        else wait for 10 sec
7 V5 p; X6 g4 F5 X8 H" i) a        if A_i=A_leave then send to die, T7 P' m- a* B6 L, O; V( L0 C
        else inc A_i by 1" K+ ~8 r; o3 q, c- X" x% x
    end
4 W- O$ y! s& Aend: J. W0 @& }3 n4 A% @9 ~/ q& p
' I* r  ~. L8 [3 ^) ]5 [$ W$ T
begin P_pick3 arriving
" `# _  l( l- z  C% |1 v& M$ z0 W    set A_i to 21( Q9 j2 w& a$ m$ X5 ^
    move into Q_induct3
2 p) s% T1 H$ m' Y    move into pickaisle.induct37 ~4 G: \% }, ^
    while A_i<=30 do begin
+ K7 H; l* |3 A4 ~! O* i        travel to pickaisle.con(A_i)1 }2 l  {9 U+ U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! S& u/ n$ o8 a- }* a+ k        else wait for 10 sec
7 ?% b; C& z, {! C9 K        if A_i=A_leave then send to die, d1 A1 s: S( V
        else inc A_i by 1
0 `0 K2 c8 r: s    end( N! R8 N. Q# ?; B5 i, u. v) G
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是个什么东东?- q0 S  m0 c' Z$ u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 q0 X8 N# h: B6 E& W
2 ]4 X% K. U4 _: ^5 e: B
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ _1 b  e6 W) I) h3 U; O8 R$ V  n
0 u# E( ~7 e! e" \9 m+ B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% s0 a' Q) ^2 W; K4 G( \2 s6 ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' ~0 z; T, F( j6 v; M& M/ e/ N# d3 n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: s, o0 e: c, f1 J3 |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 [7 Y& ?- O$ D# Tbegin P_induction arriving* E" m% r6 \2 s, h# W" \' G- I" X
    clone 1 load to P_pick(A_induct)
9 `5 Z" L+ V8 Z$ j- A+ p$ jend最大的系
, c0 Y' T% \! S' U$ U2 H( `% h1 ^2 x* W
begin P_pick arriving# N6 k  ?1 R0 P  `( H" q; o6 J% e
    set A_i to procindex * 10 + 1
# W" ~8 j; \7 V5 {3 V    move into Q_induct(procindex)
' E7 h$ U- _7 n  T9 g4 L6 O- P& e    move into pickaisle.induct(procindex)
7 a% U3 M' ~  X( \0 z    /*check the type of pickaisle.induct(i), for your last problem.*/
" n: U: k' n0 t" u) s# P0 ^0 h0 [1 J, R: \
    while A_i<=30 do begin# |# w9 P" R) i! _0 |
        travel to pickaisle.con(A_i)8 c5 |. d6 V! ^0 X2 N1 F1 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# V, Y: }6 C- D3 ]2 r        else wait for 10 sec
3 j9 a/ D4 n6 k! `+ [        if A_i=A_leave then send to die
7 l* Q6 t8 N* r3 n        else inc A_i by 1
$ X' _0 N5 p% ]1 }    end+ y  c/ c1 N: {4 I  r: {* O
end1 A% Y' g& R0 ?
: z, o) C# l' |  K
其中的procindex为整形,代表当前process的序号。
; F3 O# }8 k8 I  U* ~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-7-6 08:13 , Processed in 0.016667 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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