设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15459|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ h: d2 y& d9 O
! |! L; H/ p0 U' s: i- K. ]% 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中的数值,不知道会不会有什么不妥。
$ d: D5 Z: ^% @. |, N! e. _. |
: I1 |3 X" Q2 O/ g5 p0 Qbegin P_read arriving. l& i, G7 T: D6 n- D% c
    while 1=1 do begin
8 S+ b+ N7 H8 e: {6 W- I        read A_tote from "data.txt" with delimiter "\n"
0 i* u+ C, d4 L, ]        read A_time from "data.txt" with delimiter "\n"
' F0 `' h7 X( l. s3 L3 n        read A_leave from "data.txt" with delimiter "\n"
! z8 K) n6 n* P+ b% L( ~        read A_picks from "data.txt" with delimiter "\n"
* h+ X1 v, l% b( r# M) @9 G# G, _7 }' q        set load type to A_tote2 h! A4 L8 q- B* h% n; [; Z
        if A_tote="tote 1" then set A_induct to 10 x4 I+ w6 S9 r3 F9 I5 C% b1 }
        else if A_tote="tote 2" then set A_induct to 2
1 `3 B% Z0 m; b- B7 R            else set A_induct to 3      R9 C0 H2 R# o, e
        set A_i to 0
1 Q3 N) d+ j. z' b9 c        clone 1 load to P_induction
* n; ~: Q- F4 u7 E2 w7 r/ I; ]        wait for A_time sec8 I. w, l# [- V- [$ Z
    end. K+ f' E/ x' l2 J
end
8 F3 r, e9 c/ E8 v! o, W( _2 b& ^- \' `, N1 z4 r
begin P_induction arriving5 A8 j/ P* e' _' C
    if A_induct=1 then clone 1 load to P_pick1  Z  M# t7 Z- ?* H3 T0 F
    else if A_induct=2 then clone 1 load to P_pick2( N! R) X: J7 s( t* ?/ q# }: p8 q
        else clone 1 load to P_pick3/ V% K# W8 \, L1 R8 }
end
6 d* L' S+ j, D6 {9 L' h+ s7 g  o8 V
begin P_pick1 arriving" x% P1 P# ]) o8 G4 y
    set A_i to 1% a4 F( S0 i# h2 D' T- G
    move into Q_induct1, A# X, N( U+ j
    move into pickaisle.induct1# {! n3 w! h. F# `6 L, m6 g6 B
    while A_i<=30 do begin% _$ v# |' F# v3 s( }7 e
        travel to pickaisle.con(A_i)( T2 x7 y4 c* J5 q. Q0 o! D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 k9 V4 ^( g' Y+ e0 u/ S( j
        else wait for 10 sec
. ^8 w9 s; O" x        if A_i=A_leave then send to die; `6 l+ ?$ k9 h
        else inc A_i by 1' l' o2 b, s1 A- v$ K7 g% c* A8 ]6 o2 C
    end1 \; q( Q+ m3 d  V. I' z
end
* a- [" B, O9 D' S* o8 D
! [4 I1 [! `9 G+ T: O5 ebegin P_pick2 arriving
% @* o6 l9 m% Y, D    set A_i to 11
' h! F1 H% z1 R+ f8 O( e    move into Q_induct2
% H: R$ b1 _  F* P    move into pickaisle.induct2
; d) G+ |6 H4 _& H- P  P+ f$ x    while A_i<=30 do begin2 W7 o. t6 _8 H" w
        travel to pickaisle.con(A_i)
9 L' D' B! z, S8 J: p- h0 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 H4 N5 B" u( `: f        else wait for 10 sec6 z$ b% }1 O; c, p/ Q9 V( s: Q/ O
        if A_i=A_leave then send to die
8 W3 a9 \1 C* c- D% D$ C0 c& s' x& x) J        else inc A_i by 1
+ g& n3 V, S& G    end9 q. M! W0 G8 m! b6 ^
end9 O7 ?! j8 k/ Y5 {' M" F
. a  h: `7 C7 w. z& T* |% d
begin P_pick3 arriving0 A7 M! ^. A9 W3 B, t- O
    set A_i to 21
% x- X; ]2 P5 Q    move into Q_induct3
4 w- k3 g( j. K; e- K3 G5 z; d- i    move into pickaisle.induct39 F8 Y* l1 x/ k3 j/ [/ C& d1 z
    while A_i<=30 do begin9 f$ Y! u7 c7 O, d1 j
        travel to pickaisle.con(A_i); v+ P& [2 o4 n. h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, c/ Z2 G: u# G. d        else wait for 10 sec
7 i* v' O8 ?' h+ s! z        if A_i=A_leave then send to die$ H; P) s1 a1 b
        else inc A_i by 1
6 v2 v; M, i( Q0 j9 n0 G8 h  O    end
$ _" l' n  O- }- P: C3 u% send

最佳答案

查看完整内容

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是个什么东东?
7 X  W+ u, J$ Y# G; ?8 O: K1 Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& y( ~1 m" E- O+ c# @  T8 U+ \+ ^

0 R( t; ~5 Y& H4 q! P( O* N' o4 _7 ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) p" }3 y+ c* e! ]

* w/ H( d0 |* Z2 N. Z- U" |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 c& z5 j4 }- A: T; C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! W9 E6 j, s% |# @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ {6 A) h7 }+ p0 S+ }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  F( Z" i" O0 y, W+ s9 |$ |$ G9 E) z5 D
begin P_induction arriving
3 ~8 T, k$ T3 q% ]/ l  x. T( A2 b7 ]& f    clone 1 load to P_pick(A_induct)  T5 i8 ~' [6 `+ r* Z. n+ d* ~
end最大的系
4 s! _3 x0 ?/ v9 t* j  M/ a' y: T( c  i! |: u* k
begin P_pick arriving2 V# Q; N0 J( z# C( F0 l/ g+ L
    set A_i to procindex * 10 + 1" i# y! G$ f/ S7 J; P1 B1 P" y
    move into Q_induct(procindex)1 H0 r. ^4 t4 R, `1 k# H3 d
    move into pickaisle.induct(procindex)# ]+ i0 R- P: t, f, ~
    /*check the type of pickaisle.induct(i), for your last problem.*/. k8 Y" }: s  X1 m9 c: c; m' H; D

  U3 W# C6 U. @; G    while A_i<=30 do begin
! [" c& U: ~$ [0 r) ]        travel to pickaisle.con(A_i)5 H' G! ]) i7 J! A( U9 }) _/ c; F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 S& }2 B8 S: X; {$ j6 a+ S        else wait for 10 sec4 c; k9 B7 M5 w8 [; U( z6 M% S" V
        if A_i=A_leave then send to die
/ P" W# c: u0 {$ j        else inc A_i by 1
0 J1 r/ |- x" T) X1 l/ c4 d$ H    end
; f: Q9 U) I# G9 r9 K' `end
' T6 m' S. o8 t' }/ X1 @$ k" E1 w9 b
其中的procindex为整形,代表当前process的序号。/ k/ z+ O4 X& _) v
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-11 15:03 , Processed in 0.015440 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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