设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12084|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# R4 i, [0 i/ \7 x0 k
' ^3 D: d- E$ B6 n+ D% J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 B; `/ N) W8 f- @1 n; {
; d3 u; H5 k( b1 J  L
begin P_read arriving
6 F$ P2 a) R. A    while 1=1 do begin' x+ G) Q% u6 Z- E; T- y
        read A_tote from "data.txt" with delimiter "\n"
, M/ R: @1 ^; s( ]' u, {& z$ z! X        read A_time from "data.txt" with delimiter "\n"' b0 `2 @8 ^/ j; i' O
        read A_leave from "data.txt" with delimiter "\n"  p- T) F& K% F5 @6 N
        read A_picks from "data.txt" with delimiter "\n"& y; j3 @$ V* S9 ]+ k  M, I4 @
        set load type to A_tote
0 U" Q$ k1 o1 D        if A_tote="tote 1" then set A_induct to 11 B2 P0 _( Y- _
        else if A_tote="tote 2" then set A_induct to 2
. F# V6 c* v/ A& h- ?6 B            else set A_induct to 3   
, k% y% v6 u  ]9 P! l1 J- V! G% d        set A_i to 0
' k" f! u8 G% [- T8 X' q        clone 1 load to P_induction
' z  q  W* a  ]  F& W, e- G5 R        wait for A_time sec+ n/ e4 R+ Y$ m& E0 ]
    end
4 t* I! E$ [" P# a' pend
+ P. F5 Q2 X2 F+ j* U- K0 U
6 d- M3 B8 i/ F( H9 G0 pbegin P_induction arriving( P: w9 d7 c5 D6 m
    if A_induct=1 then clone 1 load to P_pick1
( ]. B" {7 U& j& Y  X5 q& G    else if A_induct=2 then clone 1 load to P_pick2
1 \# Q3 p( {( {        else clone 1 load to P_pick3  o, W8 E8 G" n, W$ _4 c" _
end' I# u& `1 q" h

9 K/ V: \6 t: w* @) I5 Y  J% zbegin P_pick1 arriving; d% K# a, v6 I
    set A_i to 1
0 D, p1 q" r9 z6 v& v( F9 ~& f% i    move into Q_induct1: S& g5 s3 n8 t: h0 [( {( _+ U
    move into pickaisle.induct1
$ q) F: c9 ~' L( q+ Z5 k    while A_i<=30 do begin; z1 h3 S, m4 l" n& J$ d
        travel to pickaisle.con(A_i)
( l2 u7 E! f& W! h7 q/ e+ k+ v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ _3 |* o  W# @, ]! E0 L& L
        else wait for 10 sec6 v) _! T. P6 z' i9 G
        if A_i=A_leave then send to die
: j7 ]* G7 {1 k. x& y" Y: X        else inc A_i by 1
, F( h  o6 {$ c! T* p+ K' p0 g    end! V* ?, a, G6 W3 B
end0 D6 E# @, _# E

: U* j( ?% o. tbegin P_pick2 arriving
1 ^& E( Y( ~" a    set A_i to 11
2 V1 L' _( |8 t    move into Q_induct2
: {- D% o' m: Y4 `6 ^, ?# p    move into pickaisle.induct2! m1 B! A/ _, l7 J9 ]( a3 B
    while A_i<=30 do begin+ W2 U+ M2 W- J9 V5 [' ~1 [
        travel to pickaisle.con(A_i)% D+ J+ u" `/ I; i, T% O# q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ~1 O6 ]5 p! B, r: D0 m% M# X        else wait for 10 sec
* @; M4 m' e  C7 _6 f( s% U* f0 q        if A_i=A_leave then send to die. u! N; s! w7 ]5 W
        else inc A_i by 1
% A' j1 y9 P2 y- g6 S    end) s+ _: V( q% j6 k4 t
end, I  w# R% P$ a4 o
4 j3 w6 B7 _( r* j7 H
begin P_pick3 arriving
8 h9 Q1 M, q) C0 ]' a' v    set A_i to 21) w% T2 H9 [; q1 O
    move into Q_induct3
/ ]. @5 l1 K8 {# d    move into pickaisle.induct3
5 j: [5 s. D% d" w% T! x    while A_i<=30 do begin
, A& @6 t& [0 x# a  F        travel to pickaisle.con(A_i)
2 g2 B! Z2 w* Q' l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ {. U2 o# c& b3 k" e+ {( P9 w) i        else wait for 10 sec2 B6 g( ]$ m  O4 k
        if A_i=A_leave then send to die
( \. o2 X- m8 b! G        else inc A_i by 1! x# Y* K: z! M9 R3 W1 F/ k: d
    end& R# a3 \4 ~  j, h3 N4 [5 y
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是个什么东东?
) K3 k3 c* Y! }8 ^& }% `2 A) Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& i2 n# h' [) d6 }" J  k: l

4 s3 T9 e  _  n) M* ^) \, i+ YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& k( k( s2 |/ `( }# d0 U
6 m' }. i# |; p: o) F& y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* y6 B  Z' @, s% d: K  Q$ H. E1 }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 A7 x: x6 `. {, R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; a2 V. f5 _4 Q9 f: O* o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 l7 s1 ?& }) M1 e. ?* U
begin P_induction arriving
0 x& z* g; v5 x  ]* V; @( |, w8 `    clone 1 load to P_pick(A_induct)
: S0 Y& {6 u: kend最大的系. S0 G/ ?: I, X# g" ~
3 L  w& R% X( W9 |% ]* m0 R0 h
begin P_pick arriving
( r* K6 O2 y4 j7 D, J1 o6 C6 L    set A_i to procindex * 10 + 1
/ ^( U9 `( P& T3 z; p. }    move into Q_induct(procindex)
$ y! F- X9 a6 y' {( c& s& z/ |    move into pickaisle.induct(procindex): y4 ^: \* E- V& `: ]# P9 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
) N- H: C! r' J$ n1 u. \' ]% d
* J# j  X" v; l0 Q* d6 \  [0 u; D    while A_i<=30 do begin# p5 y$ Y# I6 `7 g  w
        travel to pickaisle.con(A_i)
) |" _! l! z8 S- M3 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 [  o0 H6 h( w/ C1 Z
        else wait for 10 sec: I" }: u6 l3 M& ?" n9 B5 H8 c
        if A_i=A_leave then send to die8 N3 D3 U- q! |/ f( k/ D! l1 ?
        else inc A_i by 1& D0 ^% B* G# M4 p
    end% `5 i4 A6 P! P. u/ Z" [
end+ k2 t) M  H2 g! j& v
6 |; w# n* d# C
其中的procindex为整形,代表当前process的序号。. W/ e, T& Y0 Y1 f2 Z8 i; S
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-12-26 08:31 , Processed in 0.018195 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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