设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15160|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 N$ k3 |9 p2 h4 V/ K5 W/ m
& @: L" o  v6 F4 I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 n, e1 m( ]3 r( X4 H" E: i

9 L8 d4 l: ]7 O1 Q4 s( ]* Y1 }begin P_read arriving
. z, b2 {9 A0 }* v- ], v    while 1=1 do begin+ E$ C7 |& _* h& h9 I
        read A_tote from "data.txt" with delimiter "\n"
: m3 T- ^, \1 m. d* ~' R9 a+ E        read A_time from "data.txt" with delimiter "\n"1 O4 b$ L# L" ^  ?1 R0 t( ]
        read A_leave from "data.txt" with delimiter "\n"
9 ]3 o9 _: L9 Q0 C  J6 n        read A_picks from "data.txt" with delimiter "\n"/ W2 {+ |5 s2 W6 _7 ?8 M' P  C
        set load type to A_tote
2 @. T: Q) I" f9 P! P        if A_tote="tote 1" then set A_induct to 1
3 v1 `- s$ g: x6 N' q        else if A_tote="tote 2" then set A_induct to 20 s% S: p+ S, B0 z) ]' m1 V5 k/ Y
            else set A_induct to 3      o9 \; W& Z; W: }' \
        set A_i to 0" [6 c* z! l' x
        clone 1 load to P_induction' l. t- p0 p4 q) X8 C; v# G/ L
        wait for A_time sec
+ y# D2 F7 K: {5 ^# H6 c7 L; c    end& v7 K2 ?: }% H! L) @: d9 ^* L, l' _
end
! T/ P- G5 @5 {4 [" [
2 B' m  A0 V0 b; _, I% F; xbegin P_induction arriving
- M- q' N& e4 Z    if A_induct=1 then clone 1 load to P_pick1$ o1 Y5 k" P1 j- n3 Z
    else if A_induct=2 then clone 1 load to P_pick27 F0 z' q6 y0 B+ y) A! L+ s
        else clone 1 load to P_pick33 n8 z$ _+ R" u& d
end8 ^2 z/ D/ V, a3 ^
! Y! A0 N! f& P
begin P_pick1 arriving
  G$ _# B2 B" q" ]& Z    set A_i to 1
7 s/ L3 z* c! x+ f1 g    move into Q_induct1
0 W; x4 h$ K' R, d2 N    move into pickaisle.induct1
3 \" k, ?2 F3 u    while A_i<=30 do begin# F+ g5 U8 P  ]2 Z% X+ T
        travel to pickaisle.con(A_i)
+ C4 q3 ~5 Q8 b  X6 ^6 u' Y7 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 s( @2 r0 E4 ?* A+ G        else wait for 10 sec  U& {7 p" Q* d
        if A_i=A_leave then send to die5 C8 e. g( T+ Z: T0 I
        else inc A_i by 1
, [  t3 J! P, {$ Q5 i$ g9 I    end! Y: p0 E6 i- f5 x: {
end; ]0 ?# z) O1 _3 x' D

5 B0 P. e4 q, ]7 O4 @begin P_pick2 arriving9 c/ Q$ s! N' |7 B# o& N" ?
    set A_i to 113 J9 h3 d( j- `- g  }
    move into Q_induct22 ^- j7 ?8 b" c& u4 ~' ]& L7 h# \
    move into pickaisle.induct2
- Z% J$ k) \: a- V; w" P! t* p    while A_i<=30 do begin6 n) I2 K7 O+ C- O+ A
        travel to pickaisle.con(A_i)* \8 g/ a3 h. S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 o$ `: ]3 I/ t4 e8 P% L5 y5 `
        else wait for 10 sec
5 \4 I; T2 Z5 T0 Y        if A_i=A_leave then send to die
$ J  g! N% \1 y& b# J! _        else inc A_i by 1
0 R2 ~3 {/ e; F+ }* t% S    end5 W* d! @, n( C! I
end
2 b% H! Z9 ~! c. P+ t
2 {1 [# R  y1 Tbegin P_pick3 arriving
8 i# b" g+ I! T  H8 I0 {& p8 U    set A_i to 21. i  }. N8 t3 I  Y; w0 N' J  A
    move into Q_induct3
7 K/ L6 b  N1 K( n* Z; M0 r! |6 d    move into pickaisle.induct38 p' b6 U8 D5 ~3 Y- `+ Y
    while A_i<=30 do begin
2 [: L& k( T* [) `  ?, V# H        travel to pickaisle.con(A_i)
% H2 n' Y" j$ S; P* v- g$ F0 `' Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Z" M# c& \) d; l0 I2 E8 M
        else wait for 10 sec
" }4 N, I  V, c$ V5 H        if A_i=A_leave then send to die9 z0 |4 d7 g1 ^
        else inc A_i by 16 H+ V1 ^6 E: j
    end* [( S) h! ]+ o; M# R. H
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是个什么东东?
3 A& V, z4 j7 O3 M0 k2 tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ v4 K# T$ t$ g. z2 n" y  h! k4 |/ C7 r, y4 v5 d9 s, m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  K! s, r) v4 M1 D  [3 q# [4 S

3 S* c0 f1 ?! Q& G0 t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; q7 x) [1 K8 O$ O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* Q: O' \" r, i5 T3 N/ |9 y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( d0 k0 `9 o& `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" _  [1 m' O3 sbegin P_induction arriving* c2 g; {+ v7 f. `- {* {$ T( k
    clone 1 load to P_pick(A_induct)
8 R5 R3 c4 @* G$ ^end最大的系
! i9 E7 C2 z" Z' q4 U8 i/ ^3 ~5 X9 [& y% Z1 I% M
begin P_pick arriving
9 z( y  n! ?; Z1 O1 \" h! g9 Z( g" T    set A_i to procindex * 10 + 1( _  ^$ u/ ^3 Z- a0 i& ^
    move into Q_induct(procindex)
  x: _; _: \! ^5 _) [- a" X( }; T: e    move into pickaisle.induct(procindex)
7 Y: w: D5 Q. W. i; x    /*check the type of pickaisle.induct(i), for your last problem.*/
+ r- d9 y# _' w0 L7 R$ y4 x, y+ t0 X# }1 \2 x2 n* F% J
    while A_i<=30 do begin
; [0 V6 c  T( Z- v* S        travel to pickaisle.con(A_i)
/ r8 h7 Y' ~, R# E% Q  x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, e- o9 o, X7 c* p  U6 o0 E- P        else wait for 10 sec: m% C' C- v- j2 D
        if A_i=A_leave then send to die
1 q* K# |9 Q9 k9 K" ?- J0 U! f        else inc A_i by 1/ o8 B7 ^4 Z( G, g
    end1 e$ U  n7 S9 s* x' n
end7 L8 i2 a& M- V7 N) Y3 E

) R, Q+ H+ p! R* w* Y. I/ M+ A其中的procindex为整形,代表当前process的序号。! b! k' V2 u+ \, I+ e
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-8-17 10:03 , Processed in 0.016117 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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