设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15346|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- U( X( p' O) k4 |5 V2 s+ o4 N9 j7 l+ U, `% i. U2 a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 l& a) }8 |9 R6 g$ j1 _
  ~$ W  @& d  v& r$ \0 Jbegin P_read arriving  M- Q4 |* p2 _9 E. d9 x' d
    while 1=1 do begin/ G7 k" t) j1 C- F  T
        read A_tote from "data.txt" with delimiter "\n"
" E: C9 c  k( W* B# T+ K        read A_time from "data.txt" with delimiter "\n"3 y7 w, y! Q3 T, G" ]6 x( V& I: {
        read A_leave from "data.txt" with delimiter "\n"
! [; E9 k% O# W/ ^# q5 O        read A_picks from "data.txt" with delimiter "\n"3 l% Q7 G1 O) P5 h4 K
        set load type to A_tote
8 Y/ X. _# @) L! e$ i3 q        if A_tote="tote 1" then set A_induct to 1. o3 D# m& Y0 x4 z3 v8 w% |
        else if A_tote="tote 2" then set A_induct to 2/ l4 L. S  |  b
            else set A_induct to 3    # X) V) h4 y* s
        set A_i to 0
6 m: N, x/ m) B; B        clone 1 load to P_induction
) B4 N6 ]+ \9 }        wait for A_time sec& b/ O3 J4 Y+ a5 k  b# D7 ^4 G
    end
: k5 v3 A" I5 L. oend
6 H4 ?" j8 E  z- @* E% [( T
9 d2 {" y" u- X* F; Ebegin P_induction arriving
2 C7 ]- ]3 b, M    if A_induct=1 then clone 1 load to P_pick1
2 @, O; z4 z& w" `" j    else if A_induct=2 then clone 1 load to P_pick2
) H" o3 O4 O' g; I* N- i        else clone 1 load to P_pick37 L) w0 j% ?' |$ M
end
9 C* k9 a: p7 e0 C7 {) v5 J5 h& n8 y, S) K
begin P_pick1 arriving& \/ H8 _1 q( c- \
    set A_i to 1" Y# t3 r& d( |4 w9 T) e- x# K
    move into Q_induct1* G" |: ?: N) M) K9 i! p$ i
    move into pickaisle.induct1
, W2 C9 p9 ]  u' l2 h    while A_i<=30 do begin
. B/ Q* u- R) |# F& n- u3 A* J        travel to pickaisle.con(A_i)2 t: P0 c( H" P% g# D) G/ p* e' ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: F8 D4 m1 U2 z7 X7 b        else wait for 10 sec. v! [# n' }* E. q( C( V! z/ q
        if A_i=A_leave then send to die/ `  U: o0 B# i; `) a' r
        else inc A_i by 1
% E& n" |3 }! F- D7 w+ k, J7 `$ z$ r* ?    end
( r  K# P7 b+ K6 O; _  P: Qend& |: m( q( `$ M7 i! }
- J) O" b- T  N2 |3 v; i
begin P_pick2 arriving& ]- T3 P: M, L* Z2 T/ O
    set A_i to 11
8 c  A0 H& _8 \$ ~    move into Q_induct27 t3 G, c6 P6 J1 x& m# R( S* r+ p
    move into pickaisle.induct2' s1 ]2 }5 H6 |5 T
    while A_i<=30 do begin
% F& N& Z5 K4 I1 H        travel to pickaisle.con(A_i); u; P0 W5 \* s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* F0 W+ w$ _9 Q0 B( e
        else wait for 10 sec
- Z" ]( k. T+ l$ |        if A_i=A_leave then send to die5 I8 p+ d: M* Q5 W9 Z
        else inc A_i by 1* [0 |/ H$ o3 i# T
    end2 G, X! |3 H! s. a  U2 _% C
end. C$ U; U! N& C4 i' d" w5 }
% q4 [3 `$ ]8 m; u4 [3 {
begin P_pick3 arriving
4 J0 b* k" S2 j. K    set A_i to 211 j5 @2 e) y1 D# D6 V- L( R
    move into Q_induct3+ L0 d7 c+ I; q: K; u) @6 D
    move into pickaisle.induct36 G2 ^1 M$ N; K+ Q! ?
    while A_i<=30 do begin
7 g& v7 K% u; S7 n        travel to pickaisle.con(A_i)
; @' ?6 d! J% S' a+ f+ ^& i8 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 f4 N7 D* }7 W$ e) K        else wait for 10 sec# ^- L7 _+ j% q4 X8 J- E5 k, O
        if A_i=A_leave then send to die
% i& T+ }  a% V( O0 r; @        else inc A_i by 1+ H0 ~% v1 I9 r  u
    end1 e  i9 K  j7 s9 i
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是个什么东东?
% m% Z% ?/ \) U" e& w8 H* F4 \- Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 V4 ^9 C7 C- [3 [# A: f/ l8 q
4 J4 ]  X8 l3 M) WAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% o* e- [# D+ S) q7 `7 o- y7 B
& x# U, V! F, `, V" `; F, {( c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 ~7 @" s% R6 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 ?1 [  u  O) W8 A. G! N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- _0 \6 g( y" I$ W3 [# T2 S( A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 m0 V9 K0 z3 w8 x5 |7 @! i. j& vbegin P_induction arriving
- n4 t3 k; a8 L5 K    clone 1 load to P_pick(A_induct)
3 N6 `1 x- m. \% n8 send最大的系! j6 l+ u5 }* V/ x3 s

: b' T# k8 O+ [begin P_pick arriving
6 p# n: o  Y3 A, x# R7 N    set A_i to procindex * 10 + 13 L, e$ e8 Z# P) Q- i( [
    move into Q_induct(procindex)6 c7 N1 f1 s* C3 c6 q! Q
    move into pickaisle.induct(procindex)* I3 b# e( L& V) u. |
    /*check the type of pickaisle.induct(i), for your last problem.*/
' q+ G3 A) m. B+ e0 ?! a& D
% |2 _3 I, q0 F    while A_i<=30 do begin
5 Y# y' e% _& R- k& v* }/ V3 V        travel to pickaisle.con(A_i)
" Z% [; S  {- @) M( `$ L5 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 x! u  e, F) \) y- o" i* K
        else wait for 10 sec; Z% ]( Y. T- V3 W% r+ X
        if A_i=A_leave then send to die( |! f$ V( \2 G2 t  f; F8 h6 h
        else inc A_i by 1
: {6 X9 h6 v8 U- c$ a& G    end
. }. ^. L) t/ y5 l: B0 N0 Oend
% i, }! M, M! w3 q+ i$ q
; J5 t, r' ^! `/ U+ n+ _其中的procindex为整形,代表当前process的序号。, u' y; @1 z- R" B0 C' I
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-9-3 18:30 , Processed in 0.015388 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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