设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12731|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, K5 E0 d1 F' f" [! ]+ a. A% V) W2 M% _- y! r: }7 m6 Q$ w: M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' l1 D. E# p0 M; t4 h, Y
2 r9 @4 y& ]6 {: m1 ~1 {
begin P_read arriving3 O+ Q: \0 `: w+ U8 Q8 `# N
    while 1=1 do begin* H, `* J2 s' b- C  j& e
        read A_tote from "data.txt" with delimiter "\n"
% l3 S3 b0 R) f9 |6 W        read A_time from "data.txt" with delimiter "\n"
. j; S: x' J# j2 e4 w9 [7 e        read A_leave from "data.txt" with delimiter "\n"& I: w6 b) B, I
        read A_picks from "data.txt" with delimiter "\n"6 S' l, Y7 g) q7 I
        set load type to A_tote8 u9 Y5 L& j5 N! V
        if A_tote="tote 1" then set A_induct to 1+ q5 G# x8 T* O" G* e" n
        else if A_tote="tote 2" then set A_induct to 27 j5 g' d% C# O& `; ?1 d
            else set A_induct to 3   
9 P/ Y8 U% Z7 V) V        set A_i to 0
6 Z* R, @8 M+ X, [5 r$ b% S( {        clone 1 load to P_induction2 t7 L5 \, O5 e" [3 Z
        wait for A_time sec
/ h8 a0 ?$ _" r  z3 a    end
) a0 N: P/ J  Y& f/ uend
# r1 H+ S& x  G
/ j& N9 m( _3 @begin P_induction arriving6 r; z1 X6 J7 |+ t+ ?% s
    if A_induct=1 then clone 1 load to P_pick1
5 x8 B0 q6 ^* {: |. d3 V( k    else if A_induct=2 then clone 1 load to P_pick2
) b: m+ P7 a& H        else clone 1 load to P_pick34 e4 m( ^. q) }; j
end0 K$ Q: }  |! |" x$ D! X7 c- r
7 C( ?- r1 n" Y  h, O
begin P_pick1 arriving
) n3 u% _# A$ Y; H6 w    set A_i to 1! r$ c/ x$ u$ i( G+ v7 G
    move into Q_induct10 g6 v2 c% _  u* J
    move into pickaisle.induct1% W% y, m- E0 z5 U/ m% o
    while A_i<=30 do begin
: \; T; g7 F* |# J! C        travel to pickaisle.con(A_i)
( F- b' A- E! F9 b8 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* h" t; q6 d* P, C. v: ^
        else wait for 10 sec
6 y' `2 J- E/ P8 g" D& C" N        if A_i=A_leave then send to die; [/ I( j0 N6 q
        else inc A_i by 1; v9 H1 @/ t" w( H5 L3 R4 N8 {8 k" t
    end
& b1 r' X( J" _, Q6 U- N- Rend9 }, X; E# ^( z* \) P

2 ]" z, S7 N5 h4 p! s( `begin P_pick2 arriving+ D/ ?) v: {9 K: ^  l* j3 o
    set A_i to 11: r  e( W( L: G" ~
    move into Q_induct2
1 Z: d& }4 ]/ l# e; a    move into pickaisle.induct2
% {6 Y3 Z  r0 n6 U; J" Z    while A_i<=30 do begin. L7 T0 }' T  N
        travel to pickaisle.con(A_i)
1 ~3 I* ]5 z0 v9 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! V2 f; s# g& t( C+ y. a" y. j
        else wait for 10 sec# T$ \* |9 U+ [4 E4 P
        if A_i=A_leave then send to die2 C+ Y: v" h2 k6 k7 q: t4 ]
        else inc A_i by 1
* L* d" }) D8 C0 \+ Z    end
) x" U7 I# B5 `, W6 Y) wend& W/ E* E- L5 p4 i& X

1 I7 j+ k0 r: r; \" n! x+ L# x5 fbegin P_pick3 arriving' N4 {$ b" C( `. @2 Q$ h
    set A_i to 21# K- R5 ~8 K/ {6 t. e
    move into Q_induct3( X3 ]7 ^* m8 S  ]7 w& x; m6 C3 ~3 p
    move into pickaisle.induct3( Z1 t4 w, Z4 W% [2 W/ O5 W5 a; [
    while A_i<=30 do begin4 k- J3 {3 ?8 j7 T+ G
        travel to pickaisle.con(A_i)3 h: H0 G& D( a9 q+ ]. s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' c3 Z0 |+ F7 |4 B
        else wait for 10 sec, U7 A: A% i1 f
        if A_i=A_leave then send to die. T# `* x- D% _6 x- j
        else inc A_i by 15 a6 I: |5 l3 J4 Z. o
    end% Y) j1 ]% w- n8 Y& Y+ I5 {
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是个什么东东?% v; B1 z. P* d# x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& x/ i+ ?$ b7 }, [9 K. K

/ B& s2 a; r) u4 c+ \! uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" |& t* D2 C4 `; b0 }+ e
, e2 w) L* {% L3 r4 D% m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" E- B1 d( Q  O" h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 m6 T* c1 A, H, a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# _5 S4 t( c" p7 x! `3 @! }& P6 L4 e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 z! @9 z! u6 E' ?. |  M1 I
begin P_induction arriving) M  q. h& N. ]' B0 }- u
    clone 1 load to P_pick(A_induct)$ ~' N; i) x: J- z6 }- J
end最大的系8 R- ~$ Q) c1 r% I$ \  @

+ ]3 P0 j; T! q  k1 m! l7 Nbegin P_pick arriving. x! N( i2 p5 T1 p1 U2 A
    set A_i to procindex * 10 + 1+ f# o& e6 p5 R( F9 w
    move into Q_induct(procindex). m. X4 k5 v1 Q
    move into pickaisle.induct(procindex)- z% B: g7 q+ c0 N
    /*check the type of pickaisle.induct(i), for your last problem.*/
; S5 \' g/ W9 }" A# M
  ?; R4 Y! ^" D' U1 M9 w4 {    while A_i<=30 do begin
5 e4 j8 Z1 O1 Q) {* m% |        travel to pickaisle.con(A_i)
6 v4 \' d. @# f7 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& a8 K7 o. `3 H        else wait for 10 sec
5 m' s9 Z' H* D! m! z        if A_i=A_leave then send to die3 X& ^6 D. X7 N; X4 \
        else inc A_i by 1
/ {5 r5 Q& }/ j& K! q  Z& A  a6 d    end
- j+ L: y) G" [2 kend6 k4 t' P' ?0 m5 n* L- D+ J
7 t: ^  T9 [8 ~1 O8 I
其中的procindex为整形,代表当前process的序号。- R! P$ l3 {* {- w; |7 F; d/ Y! t
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-15 11:53 , Processed in 0.016113 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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