设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15202|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; X! g9 L9 F3 E  k* N
/ t% X8 H# l( E, F6 v8 _! e, u' L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ h8 z/ n$ G! o, O; ?
9 V+ f$ _0 \$ T3 ?- Fbegin P_read arriving
3 C! p6 C! k) f    while 1=1 do begin/ K4 F" u; t/ n6 |
        read A_tote from "data.txt" with delimiter "\n"
/ i$ i# @$ |/ y- u" z        read A_time from "data.txt" with delimiter "\n"
' k; p7 y4 g* }0 h: g5 a7 r# s        read A_leave from "data.txt" with delimiter "\n"' P  v: {! A& A9 F# x; X% A
        read A_picks from "data.txt" with delimiter "\n"  q  v0 k6 X, {3 r
        set load type to A_tote# Y2 ~) \! N9 ?2 T: }) ~
        if A_tote="tote 1" then set A_induct to 16 G6 y9 j# S, m0 \) U( ^: P; F
        else if A_tote="tote 2" then set A_induct to 2+ y8 S; z! p  H6 R$ V  U( y
            else set A_induct to 3   
$ c# d2 N+ X3 H( l: w        set A_i to 0
% z  L# d+ l9 w, F# g+ T& u7 }        clone 1 load to P_induction* E- D/ T: i- \$ A
        wait for A_time sec
% X4 h; |, e2 i$ |% `/ D0 M2 g    end$ w/ ^1 R' ]* T# T; y2 U
end
: t: g( j8 _2 l. {9 b6 R8 j) M1 ^% n6 a# y- D
begin P_induction arriving2 Z( ?# Y- z9 q+ }  I
    if A_induct=1 then clone 1 load to P_pick1
& U5 l) I2 f8 K0 B) ?    else if A_induct=2 then clone 1 load to P_pick2: Q6 p: T8 J$ Q+ }, O/ J9 A
        else clone 1 load to P_pick36 o1 V# n4 S5 Z, I2 {/ ]6 S
end
* p( f! C# u8 |7 J% `; [+ Q3 H: j- |: n4 c8 Q7 g
begin P_pick1 arriving
5 [7 Z7 ]" b5 U8 G" G/ `    set A_i to 1
* Q$ {; y# Y& @- ~2 K    move into Q_induct1
. c9 l' U4 O: j: g    move into pickaisle.induct1
# t2 A5 Y% ~! B, Z# K0 W/ ^5 h" X    while A_i<=30 do begin
& H, k! d9 [. X: ~; i* @        travel to pickaisle.con(A_i)
7 d- R' E+ U! N+ z$ q; r9 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 b% l. v$ ^9 ^( G% `, Z9 t" }
        else wait for 10 sec$ ^9 m& l5 I4 V# U+ ]# R+ g
        if A_i=A_leave then send to die
& M% o) `$ C2 O! y8 V- A        else inc A_i by 1
! ~% S* |, H5 Q& i3 q8 U. U" ]  ?    end5 k3 y: y. l6 g' d( ^. Q, z
end
3 B. u! H2 Z/ Q* s7 [
; P* q7 a, y' o, _: Sbegin P_pick2 arriving
: ~. a. D. b. E; A- v; X# I    set A_i to 11
' A4 [. y% a# u9 g2 E* Q    move into Q_induct2! @7 d& O2 r$ v3 D3 z8 ^
    move into pickaisle.induct2
0 _2 X7 G" g# y. H8 X, J( i0 V    while A_i<=30 do begin/ _" Q" P  ~) u
        travel to pickaisle.con(A_i): c% A' o7 i* k- o' M% e& ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ?: ~, W0 N" w: N& r) w  j" ~
        else wait for 10 sec$ R' ^$ g% ~% N4 ~( ]  R2 J
        if A_i=A_leave then send to die
0 J+ P9 W9 E% L        else inc A_i by 10 F' b: j& t1 ^6 b
    end
7 X4 |1 t7 Q- L2 J, a! p/ }; Vend8 H8 U1 @0 i9 |* H$ i) S
/ w! i! |" F2 l. o! e' B6 F
begin P_pick3 arriving
$ }6 Q6 Z4 ?8 B+ e- w    set A_i to 218 @- S1 t8 c2 f5 h' C* a
    move into Q_induct36 `6 Z1 H& n% q; e' _0 \
    move into pickaisle.induct3  b. u; F/ J6 h4 R- W
    while A_i<=30 do begin: U" o3 V* f+ _; f
        travel to pickaisle.con(A_i)
7 m# h1 F% i1 o/ p# s. X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ w7 n9 V5 g7 o% X        else wait for 10 sec, V/ @3 s8 x8 m
        if A_i=A_leave then send to die: `( o+ @% _, m/ D* }  r, h
        else inc A_i by 1! y; D% ]) F3 w, N
    end
8 Q: P8 A' ~( Aend

最佳答案

查看完整内容

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是个什么东东?& f2 U8 m4 P4 ?# R+ g' u; m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' `: s8 S+ E# I8 S8 y
- c& T3 S1 o$ ]. L0 x  _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ f% v/ e  }' d4 [9 _* i# F5 B+ {& T1 f3 {
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! M# q' @3 H# D* j- |. @- Z# \" C) Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) _' j: _9 k6 p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* J9 U3 a4 V( d, V6 p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 z5 P" R" m8 {1 n% P$ R, Y' G  }begin P_induction arriving, w# J# i! O& q, }6 }% @- t
    clone 1 load to P_pick(A_induct)
+ _4 n; L' e9 {end最大的系
. ~2 H# [8 A+ p( @1 b* B% v! {* S
begin P_pick arriving
0 T6 f& T( I! y* o( l/ O8 l' b0 ~' B7 v    set A_i to procindex * 10 + 1
. Z# [7 b* L4 f7 w. B- f  ~0 o    move into Q_induct(procindex)
7 R; |) s. C- x9 N# |* M    move into pickaisle.induct(procindex)6 ^! I6 c. E) z$ R# w. i
    /*check the type of pickaisle.induct(i), for your last problem.*/2 R: w0 ]- v3 t) A
4 G. O6 N$ g6 A) p" S: O' A
    while A_i<=30 do begin
. p: F- h4 g% g6 V        travel to pickaisle.con(A_i)% O! W- b( o+ o; h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; |1 r; H6 r3 c" ]9 H
        else wait for 10 sec
& N! ~* W& v7 L$ ~0 S2 w& `4 K! N        if A_i=A_leave then send to die
4 @6 R+ Q/ z4 P, n) O        else inc A_i by 1
( T! |1 V9 P) ^    end/ s, Y' t% m6 m5 T! O" _
end5 l+ S, {% a' F1 \# X6 _+ N

' F8 _( p* X% j  U其中的procindex为整形,代表当前process的序号。
) G' \; e% ?7 {& B2 e9 H2 O( ]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-23 01:09 , Processed in 0.018995 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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