设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14960|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. B/ y# z) Z3 @& p, |" U+ e1 I) X3 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 ^. t  \  J/ {  s5 A& K4 j$ l# H( d0 a2 t$ [2 ^
begin P_read arriving
5 z9 X, W3 M, y  `    while 1=1 do begin; j: a* C3 q% T9 [
        read A_tote from "data.txt" with delimiter "\n"
- f9 ?, R& q0 b8 v$ S/ o        read A_time from "data.txt" with delimiter "\n") E9 g$ ~: h3 r* x  f
        read A_leave from "data.txt" with delimiter "\n"
5 w1 J) m$ S% N9 {& H        read A_picks from "data.txt" with delimiter "\n"" D, r! C# M; W) E* D
        set load type to A_tote% T0 B8 r2 ]9 i# V4 q. v& J5 |
        if A_tote="tote 1" then set A_induct to 1
# j1 R' a/ s0 n- m$ ?        else if A_tote="tote 2" then set A_induct to 2
3 C0 v/ |: Y( ]$ w            else set A_induct to 3   
( H& X0 a1 ~: k        set A_i to 04 M( ~  ?+ F9 c  D' ~# k. @
        clone 1 load to P_induction; @, I! M% Z: `
        wait for A_time sec
8 I% z" q0 q1 \# A    end8 y; a) Q8 ^+ w% u& f
end0 |3 E  A" m/ x3 {
! }" {; p6 k, i
begin P_induction arriving
& B$ \7 q& e* \  O    if A_induct=1 then clone 1 load to P_pick1
. U% R6 r1 K7 t' y    else if A_induct=2 then clone 1 load to P_pick2
  ?7 P, V7 U. y$ g" {, h6 t9 L        else clone 1 load to P_pick3" E- Z1 a4 s/ Z+ X- Y" d5 K7 P8 K
end) c% Q: E- i- \/ ~5 V
' A+ f& _; ?; r' e" A
begin P_pick1 arriving1 L7 v, t) C5 K2 Y4 \
    set A_i to 13 o- L' A- d( W/ {. u; A, t2 O* ^
    move into Q_induct18 E7 K* [+ _5 k- |5 `* U5 n0 o
    move into pickaisle.induct1( V2 V" l9 C- ~9 [  x0 g/ C: B
    while A_i<=30 do begin
) Z3 C" F) w8 ~9 Q1 Z' [9 r        travel to pickaisle.con(A_i)
+ ~7 _* i0 q7 a/ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ^1 Z3 a2 C% C; V& Z! I
        else wait for 10 sec
/ h9 b5 H, a* `  J4 w" N# y        if A_i=A_leave then send to die
* z/ V# a& N% W+ D' L        else inc A_i by 10 c: \. g) \/ {: K; _' f' O
    end
$ M6 `8 \# l+ u8 Z: |4 _  |# Send  N2 v# s; `+ k2 e4 n0 `$ C4 k
; a$ M  q: W& \0 s" \4 v
begin P_pick2 arriving
4 G' B0 v  j7 T, h2 O  P: R. w5 r    set A_i to 11; {- Q' i8 p) Q# F& r& s4 X
    move into Q_induct27 U; o# ^% }9 [' Z6 c0 J
    move into pickaisle.induct24 @' j9 d9 d% v) {' [
    while A_i<=30 do begin
8 ]3 _) Y9 G" W' A: _, u) `        travel to pickaisle.con(A_i)
8 s' I7 D$ a6 \; j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# a5 ~; x/ O+ u, Z  ^% u  ?$ Y        else wait for 10 sec
, L% U- m) i9 ~3 U: U1 {6 _        if A_i=A_leave then send to die0 ^0 E& s) R' N) n! Y; ]2 f) y
        else inc A_i by 1
  v3 W& m; k; B( _, l    end
$ {- v0 o6 i, a. eend
* y6 {, ~% [4 P" F; K7 c/ Q1 R" L, s$ [+ q" D1 \/ c8 \
begin P_pick3 arriving
  l8 q% @' j1 s8 {% I    set A_i to 217 }0 |$ G& O  D% B: B1 D. u! `
    move into Q_induct3
* j2 u2 G0 c& w" C    move into pickaisle.induct3+ @4 B: n& Q! f. y% t- {, w2 L
    while A_i<=30 do begin
) [! _& t/ D8 F4 W" ]        travel to pickaisle.con(A_i)
; z% {/ {5 [. ]4 ]: D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ I2 u4 }3 F# A6 C+ m+ M
        else wait for 10 sec
5 ~' |' Y1 w+ b; T# l: _        if A_i=A_leave then send to die
) Y. }. v5 W" ]4 D& i( F        else inc A_i by 1
2 r- J& i7 |* _: d/ h0 Z9 O8 k6 t    end  X$ j; D+ L6 E  O
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是个什么东东?
5 e( B# P! Q$ z: D# Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# \8 J  p6 G) h
$ ~$ z. z( v. Y1 j
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* J+ N6 l1 c) A% H- U
0 X# \) T) a) A' F9 R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 j; C! Q; e' e- Z8 |" ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; B6 {% @9 k8 h8 m+ h& p5 ?( m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) o$ M& z3 G! j1 s3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! X+ [" `$ C, ?/ x5 s5 p+ R0 V5 Sbegin P_induction arriving
8 N9 E2 K9 p2 E    clone 1 load to P_pick(A_induct)
6 p0 v- w. T0 |" Uend最大的系# @: c+ V+ x8 R% V  J% l
: U0 z# L5 g5 }0 m3 E+ {
begin P_pick arriving
7 \4 x: j4 P" W9 i8 A1 A/ ^. O/ h    set A_i to procindex * 10 + 12 g4 }( u/ N" \# \& B$ P
    move into Q_induct(procindex)+ Z/ V1 ?  R3 b7 D
    move into pickaisle.induct(procindex)
+ |% n/ l& w, ~    /*check the type of pickaisle.induct(i), for your last problem.*/  U2 i' H1 N9 \9 E; K3 }9 N' G

# i" W* N6 h9 z5 |% N    while A_i<=30 do begin! c2 P' ]. f* h4 ^2 u4 {4 Y
        travel to pickaisle.con(A_i)( \6 e5 ]# W) J2 P  D! P9 `) N! H8 u0 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G5 L9 ^& \. y3 V        else wait for 10 sec+ ]$ u/ [2 @" [0 \
        if A_i=A_leave then send to die
7 s% [5 n/ ^# W' S        else inc A_i by 13 ?! |5 N8 N$ u, I
    end
+ t: c% X- }3 S5 Y& B9 Wend
' H) \+ q8 y. Q/ L4 y( s+ V  G5 K5 U1 E: h& I2 t5 H' }
其中的procindex为整形,代表当前process的序号。
+ t+ |8 [1 ^' C8 @3 Q* ~) e5 ^3 istation和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-1 14:18 , Processed in 0.016657 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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