设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15141|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  R: t/ p) r7 J, w

. V2 |4 o( \' J8 R* u& [我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( q- H1 l* |) [( @4 ?# J6 L+ p
' q. ]4 d4 ]; d# Cbegin P_read arriving; R0 r# Y! I5 _" U4 E+ U
    while 1=1 do begin
  o8 _9 P( \8 {        read A_tote from "data.txt" with delimiter "\n"4 V/ a/ W  q; h9 E
        read A_time from "data.txt" with delimiter "\n"
2 @. v) B" b6 l1 F7 Q$ e: ?        read A_leave from "data.txt" with delimiter "\n"
0 x, c; D) l1 @& K        read A_picks from "data.txt" with delimiter "\n"+ ]+ l, o, |7 ^/ v
        set load type to A_tote: ^; j( H0 Q5 s* E7 X
        if A_tote="tote 1" then set A_induct to 11 f6 N* U/ G$ k
        else if A_tote="tote 2" then set A_induct to 25 o* \2 ]: T5 C) U' o
            else set A_induct to 3    & U% [9 \2 G1 A5 J) r8 Y0 g$ Q& @# @
        set A_i to 0
& x& |8 s9 a  o# `8 i* d# M        clone 1 load to P_induction
3 a( ]) k& d& p( l" _" z        wait for A_time sec8 _2 @  n6 V: Y0 u0 r" b
    end
* X9 R  }1 G  xend; s5 L% p& k+ Z! S* v& Z+ D

7 y7 F2 O/ D, Z  `begin P_induction arriving2 ]$ V, S- o: Q: A  @. ?
    if A_induct=1 then clone 1 load to P_pick1; O3 L. _' @% x8 d
    else if A_induct=2 then clone 1 load to P_pick2+ c8 y: H' V% a( l
        else clone 1 load to P_pick3) ~4 E) W1 B5 J1 _& p3 V" _  K1 a
end' l/ E: V" `* N2 G

% L) K+ z3 u4 obegin P_pick1 arriving6 N" b5 _0 \( l1 G$ k% T
    set A_i to 1
0 t# c$ m/ G) t    move into Q_induct1: U6 f6 m, B5 ~3 F( t
    move into pickaisle.induct1
" W3 G6 q1 _7 y& c2 u/ e4 g6 O, j    while A_i<=30 do begin
0 U5 ^& G: U% J% v$ ^& M        travel to pickaisle.con(A_i)
3 |" ]* `, X" y( n# H- G# t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) E/ H% ~# S4 U3 t/ m$ |        else wait for 10 sec
: Y5 a+ k5 G1 f/ c) D" M$ E        if A_i=A_leave then send to die% b0 ]) |+ f. A) R# T; x8 D
        else inc A_i by 1
% S) I9 a, E% `0 w3 v9 L    end- ?# H1 b% W+ K6 b, v! \* K6 o
end
; Y+ q6 j; f  B; I& e7 {" w1 {0 @$ s
begin P_pick2 arriving) @0 l$ R0 j6 Z9 J" s7 z) r
    set A_i to 11# d  v. L( \, y9 ^- {
    move into Q_induct2
. M) ^' l4 P  {    move into pickaisle.induct20 \9 t- Q  D' J6 G) A9 w6 Y. F
    while A_i<=30 do begin
. h/ d) w" d5 f1 u" K! e        travel to pickaisle.con(A_i)9 R6 g- W' ?, t: t- g' X# h/ C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ S! V( b$ u, G; x& f+ W3 Q2 g4 p1 E        else wait for 10 sec
9 l9 ?% V: P4 d! `" y        if A_i=A_leave then send to die
" D6 B* t6 v4 y        else inc A_i by 1* F! Y1 M) `% C' I
    end$ b" T+ F. [8 G+ H: Z1 t) m
end; \0 U/ V" c6 e' t
7 B3 d2 Q3 ]4 i; S5 b. q2 c
begin P_pick3 arriving7 T+ S/ `- S3 g: e
    set A_i to 21- X# S4 J. o( w) R8 X3 k# x) W  S- O
    move into Q_induct3
, {$ \: y. E2 [" J6 C    move into pickaisle.induct3
2 c8 T7 P+ P  F! v2 i% Z* b    while A_i<=30 do begin
1 T! w/ _; i7 J2 o        travel to pickaisle.con(A_i)
+ [* t3 g" t/ t  {5 w/ ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E8 Y( Y. @* q' H$ @  x8 p5 \
        else wait for 10 sec" u! D3 ?! s1 I1 h
        if A_i=A_leave then send to die+ {/ u' y  `6 Q2 h% l2 \* [2 J% V
        else inc A_i by 1: |5 Y* G" v/ X# |- B
    end
' F7 G" b0 }5 l- c$ _8 H6 b, L* lend

最佳答案

查看完整内容

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是个什么东东?+ Y4 I/ j" g5 u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! f3 A: h. b6 W9 m. p
' [' P! |6 j6 j1 J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 p$ u- b1 K- a0 @% M1 r

) v3 K- v. J: j3 o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 g5 U- ~+ |5 ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; J, `! H6 e  m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ Z/ P; Z7 g8 ]) c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 [: J& b$ a5 ]2 j* o% j6 cbegin P_induction arriving
5 ^; A% N/ B; r& W; c3 R    clone 1 load to P_pick(A_induct)
9 `# d8 a9 `3 U2 u  kend最大的系
( u2 u* l% @0 k& S, g' D6 W8 F  J( [8 X
begin P_pick arriving
  }+ q" w3 x* |; F+ c    set A_i to procindex * 10 + 1
0 H) Y- w5 ~* E    move into Q_induct(procindex). y9 v# j; x' K; l  ]; E& N9 G/ a
    move into pickaisle.induct(procindex)! C8 s4 N- m% L# M2 ?
    /*check the type of pickaisle.induct(i), for your last problem.*/2 c$ ^! U" N+ V  ?* N' ]
4 q" A& u/ t5 c
    while A_i<=30 do begin
# I0 P- j- r" @- R        travel to pickaisle.con(A_i); O( x* q$ a: K+ E( {; `; G0 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 |5 p" a% s* L' m9 j, o7 q& B
        else wait for 10 sec6 f; d5 K/ D6 U) P2 a2 b  n, {
        if A_i=A_leave then send to die
. g# ^- U4 ?# I# L2 N4 `+ `9 a8 c        else inc A_i by 1
( W! ~) U2 X5 J    end
: ]! g7 U0 ~0 I( U7 }% O" \0 s$ Gend" G/ ^! u4 [1 d0 i2 Q% Q/ I
. V8 d- S! }7 s+ X& j
其中的procindex为整形,代表当前process的序号。; l+ |+ Z9 [1 E9 E  L( ]
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-14 13:33 , Processed in 0.019249 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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