设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10668|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- J# S0 m4 o1 G8 P
3 _, @. y7 G/ }* 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中的数值,不知道会不会有什么不妥。2 \1 L7 G, o& W( H; t8 D

6 D% o% P3 L9 `$ [4 s' `+ Pbegin P_read arriving0 M$ E, ?6 M& O% }
    while 1=1 do begin
7 P; x% G3 q- R        read A_tote from "data.txt" with delimiter "\n"
, u1 T! q/ s4 @& k        read A_time from "data.txt" with delimiter "\n"
4 D: j/ k/ o9 s  C        read A_leave from "data.txt" with delimiter "\n"" C; B( y" a  F
        read A_picks from "data.txt" with delimiter "\n"" c! r  Y2 U4 Y+ k3 C3 z
        set load type to A_tote
. _: m/ P) Y: H  B2 i6 `* |1 f        if A_tote="tote 1" then set A_induct to 1/ r* @* H+ f8 k9 n1 d
        else if A_tote="tote 2" then set A_induct to 2% w& n) V1 o* _3 V2 H4 D) V
            else set A_induct to 3    ) ]5 g# @0 B; U1 a% k# U3 R
        set A_i to 07 q, n0 k3 a! R% A
        clone 1 load to P_induction8 p$ v3 t" S8 T9 ^, m
        wait for A_time sec- D$ g5 s) i. b! k" G, l
    end
- L/ W. n9 t) H; Y& ]" a5 dend2 W7 Q0 V8 _) _4 ~' A" z
2 j! o, _! z& y! n- P# c
begin P_induction arriving
2 f. P4 w/ ^7 Y: G) \; N$ e5 i    if A_induct=1 then clone 1 load to P_pick1
9 o5 z% H" y4 T) L    else if A_induct=2 then clone 1 load to P_pick22 ?" G+ K' _  p% ]) k3 E( H, U, F5 e5 B
        else clone 1 load to P_pick3. c6 {' R8 m8 s2 J
end
4 P& V" O0 \5 }6 X- ~5 N+ K' d
6 d& B# N; F7 l5 z3 sbegin P_pick1 arriving
0 d. i* s) t7 ?+ Q$ O& `; A. D1 v( y    set A_i to 1
% i! I8 k- i  D9 f    move into Q_induct1
3 E4 J8 _, ?) _    move into pickaisle.induct1
) [! b: ~8 F1 t9 ]9 K9 p    while A_i<=30 do begin7 d( W5 B& J! `* Z1 p
        travel to pickaisle.con(A_i)
' J6 W+ Z7 G# a5 D6 J% C. W0 Q9 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; e& f6 W# s+ {2 _
        else wait for 10 sec$ f+ O2 F9 F9 R7 }% h$ \! Z( C
        if A_i=A_leave then send to die4 Q+ H# l( H7 g  \1 Y8 ^
        else inc A_i by 1
. l+ T7 V' a; q2 W. x) Z    end4 X' j% u/ v) e6 o8 U* z  ]: T
end
! v1 s. {: n; Y- g0 m- \# r+ ?( p# K1 R; ~
begin P_pick2 arriving8 q2 B4 i! T1 U/ \
    set A_i to 11
$ C4 f' k. ?, q1 ~7 [" _9 M    move into Q_induct21 z9 B! l, y3 O( x
    move into pickaisle.induct28 E2 U- v9 h% g* f
    while A_i<=30 do begin( M7 J' s! ^% F* u  Q
        travel to pickaisle.con(A_i)8 e, N1 w; t1 @1 T! D( `  d$ B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) `: Q. S) d. S9 l
        else wait for 10 sec$ k0 k( h& e5 W; Z5 m; h
        if A_i=A_leave then send to die
1 M) s9 E6 e" |: J% Z" A3 q        else inc A_i by 1
9 h# y. x. I, D/ ^" s    end& w; s+ m8 e6 Y+ @
end
. ]9 G# v3 X( M7 z" J
5 n, z3 V6 U' H0 u+ s7 o% Dbegin P_pick3 arriving5 w1 ^- K7 y/ s. h& m$ d
    set A_i to 211 Z# a; l: d- K4 M$ }6 K% d
    move into Q_induct36 ?9 b! M8 b1 z9 E+ I# {
    move into pickaisle.induct3
' L! o1 Z* q, Z* I8 Y$ M/ i" [    while A_i<=30 do begin8 N5 J, \' {/ e2 W9 ~
        travel to pickaisle.con(A_i)* ^4 `- H! u$ t1 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h1 a" m8 O/ ^/ Q. S1 h        else wait for 10 sec- [3 i$ H3 l6 ^
        if A_i=A_leave then send to die, P( C; N- }; G6 y1 k- M
        else inc A_i by 1( P" Q6 H# m/ j, N  q5 _5 S
    end
  P% M$ b$ g" D; eend

最佳答案

查看完整内容

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是个什么东东?; ?+ q. v" l# @, a4 n5 c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" p2 T" s8 u3 b6 R- g& `7 d2 Z- F) D; R' ?4 e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ U% o. H7 F! P3 Z, R: o$ M, U0 f0 m0 z3 ?4 O1 M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  [' {  f' l" X/ V7 Z. f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; A' d2 g; t9 d8 S6 s6 A( v$ N2 A2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 ?2 [* S+ u+ f+ M2 J+ v3 s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 A+ b; k3 S) E" M) h
begin P_induction arriving
: @5 F, V& K, T  P    clone 1 load to P_pick(A_induct). U  o$ A- n+ ^6 Z! e! N
end最大的系
; ^- ^8 G, I4 x* E' U$ H6 L2 M6 b! j; Z  V3 t
begin P_pick arriving
/ d! T% j0 ]  u6 q- s    set A_i to procindex * 10 + 14 |; i9 |7 W' U8 p; J# _
    move into Q_induct(procindex)) C' `9 H, e  J# n
    move into pickaisle.induct(procindex)! W9 e7 i' F0 U2 F
    /*check the type of pickaisle.induct(i), for your last problem.*/' U; A; c; L9 m& Z8 A

1 f% M" P& w, ]    while A_i<=30 do begin
( o4 s8 S+ m+ H2 R. T        travel to pickaisle.con(A_i). w5 ]* j* N8 b( S: a/ Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 P6 H: s+ A+ x' P" G4 m5 F        else wait for 10 sec
6 L! W+ J8 g. [9 X        if A_i=A_leave then send to die
$ Q9 [0 c" G; H4 Y- P4 @        else inc A_i by 12 q$ w$ o4 b: w
    end! d% O2 b/ F( t5 _
end  l) W) a3 Q$ T5 G. H! C
; t8 D( _* K' m$ y# s- V- V
其中的procindex为整形,代表当前process的序号。
% J, {) \8 c+ A6 l- F/ w  j9 Q4 `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, 2025-9-18 05:28 , Processed in 0.018581 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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